Class: ROM::CommandProxy Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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, root = Inflector.singularize(command.name.relation).to_sym) ⇒ CommandProxy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CommandProxy.



14
15
16
17
# File 'core/lib/rom/command_proxy.rb', line 14

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

Instance Attribute Details

#commandObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'core/lib/rom/command_proxy.rb', line 11

def command
  @command
end

#rootObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'core/lib/rom/command_proxy.rb', line 11

def root
  @root
end

Instance Method Details

#>>(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
# File 'core/lib/rom/command_proxy.rb', line 25

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

#call(input) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'core/lib/rom/command_proxy.rb', line 20

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

#restrictible?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


30
31
32
# File 'core/lib/rom/command_proxy.rb', line 30

def restrictible?
  command.restrictible?
end