Sha256: 76b3ec8049aaf17efdb4a70f34dff21fa591ffeca507467c63f8439d61350a9e

Contents?: true

Size: 361 Bytes

Versions: 4

Compression:

Stored size: 361 Bytes

Contents

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

      def down(&block)
        @down = block
        self
      end

      def apply(input)
        @up.nil? ? input : @up.call(input)
      end

      def reverse(output)
        @down.nil? ? output : @down.call(output)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lou-0.2.3 lib/lou/transformer/step.rb
lou-0.2.2 lib/lou/transformer/step.rb
lou-0.2.1 lib/lou/transformer/step.rb
lou-0.2.0 lib/lou/transformer/step.rb