Class: ROM::Repository::CommandProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/repository/command_proxy.rb

Overview

TODO: look into making command graphs work without the root key in the input

so that we can get rid of this wrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ CommandProxy

Returns a new instance of CommandProxy.



8
9
10
11
# File 'lib/rom/repository/command_proxy.rb', line 8

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

Instance Attribute Details

#commandObject (readonly)



6
7
8
# File 'lib/rom/repository/command_proxy.rb', line 6

def command
  @command
end

#rootObject (readonly)



6
7
8
# File 'lib/rom/repository/command_proxy.rb', line 6

def root
  @root
end

Instance Method Details

#>>(other) ⇒ Object



17
18
19
# File 'lib/rom/repository/command_proxy.rb', line 17

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

#call(input) ⇒ Object



13
14
15
# File 'lib/rom/repository/command_proxy.rb', line 13

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