Class: ROM::Repository::CommandProxy
- Inherits:
-
Object
- Object
- ROM::Repository::CommandProxy
- 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
- #command ⇒ Object readonly
- #root ⇒ Object readonly
Instance Method Summary collapse
- #>>(other) ⇒ Object
- #call(input) ⇒ Object
-
#initialize(command) ⇒ CommandProxy
constructor
A new instance of CommandProxy.
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
#command ⇒ Object (readonly)
6 7 8 |
# File 'lib/rom/repository/command_proxy.rb', line 6 def command @command end |
#root ⇒ Object (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 |