lib/lou/transformer/step.rb in lou-0.2.3 vs lib/lou/transformer/step.rb in lou-0.3.0

- old
+ new

@@ -1,23 +1,27 @@ module Lou module Transformer class Step def up(&block) - @up = block + self.up_blk = block self end def down(&block) - @down = block + self.down_blk = block self end def apply(input) - @up.nil? ? input : @up.call(input) + up_blk.nil? ? input : up_blk.call(input) end - def reverse(output) - @down.nil? ? output : @down.call(output) + def revert(output) + down_blk.nil? ? output : down_blk.call(output) end + + protected + + attr_accessor :up_blk, :down_blk end end end