Class: Zx::Steps
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Maybe
Class Method Details
.step(step) ⇒ Object
8 9 10 |
# File 'lib/zx/steps.rb', line 8 def step(step) steps << step end |
.steps ⇒ Object
12 13 14 |
# File 'lib/zx/steps.rb', line 12 def steps @steps ||= [] end |
Instance Method Details
#call ⇒ Object
17 18 19 20 |
# File 'lib/zx/steps.rb', line 17 def call list = self.class.steps list.reduce(Some()) { |result, step| result >> send(step) } end |