Sha256: 0e2ba3bc7032dc7a1682a4fda3bdc61023ea31cd0bc630bd12ac54491491a6f8

Contents?: true

Size: 516 Bytes

Versions: 2

Compression:

Stored size: 516 Bytes

Contents

module ROM
  class Repository
    # TODO: look into making command graphs work without the root key in the input
    #       so that we can get rid of this wrapper
    class CommandProxy
      attr_reader :command, :root

      def initialize(command)
        @command = command
        @root = Inflector.singularize(command.name.relation).to_sym
      end

      def call(input)
        command.call(root => input)
      end

      def >>(other)
        self.class.new(command >> other)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-repository-0.3.1 lib/rom/repository/command_proxy.rb
rom-repository-0.3.0 lib/rom/repository/command_proxy.rb