Sha256: 4e19322cbec3e75346b122171fdb14a1a9bc9f73dbe997745b24b4430a5b5066

Contents?: true

Size: 445 Bytes

Versions: 1

Compression:

Stored size: 445 Bytes

Contents

module Lou
  module Transformer
    class Step
      def up(&block)
        self.up_blk = block
        self
      end

      def down(&block)
        self.down_blk = block
        self
      end

      def apply(input)
        up_blk.nil? ? input : up_blk.call(input)
      end

      def revert(output)
        down_blk.nil? ? output : down_blk.call(output)
      end

      protected

      attr_accessor :up_blk, :down_blk
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lou-0.3.0 lib/lou/transformer/step.rb