Class: Lou::Transformer::Step
- Inherits:
-
Object
- Object
- Lou::Transformer::Step
- Defined in:
- lib/lou/transformer/step.rb
Instance Method Summary collapse
Instance Method Details
#apply(input) ⇒ Object
14 15 16 |
# File 'lib/lou/transformer/step.rb', line 14 def apply(input) @up.nil? ? input : @up.call(input) end |
#down(&block) ⇒ Object
9 10 11 12 |
# File 'lib/lou/transformer/step.rb', line 9 def down(&block) @down = block self end |
#reverse(output) ⇒ Object
18 19 20 |
# File 'lib/lou/transformer/step.rb', line 18 def reverse(output) @down.nil? ? output : @down.call(output) end |
#up(&block) ⇒ Object
4 5 6 7 |
# File 'lib/lou/transformer/step.rb', line 4 def up(&block) @up = block self end |