Created
July 13, 2019 16:11
-
-
Save fernandes/c1b13e8fa022b0599055acd0e860db55 to your computer and use it in GitHub Desktop.
Trailcrazer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dummy3 < Trailcrazer::Operation | |
step :one | |
step :two, StepTwo | |
# can be a block (pay attention to use {} and not do/end) | |
define_step :one, ->(ctx : Trailcrazer::Context, params : OperationType) { | |
ctx[:sum] = params[:initial] + 4 | |
true | |
} | |
# or a Class (inherit Trailcrazer::Step) | |
class StepTwo < Trailcrazer::Step | |
def run(ctx : Trailcrazer::Context, params : OperationType) | |
ctx[:final] = ctx[:sum] + 6 | |
true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment