Class: ROM::CommandProxy Private

Inherits:
Object
  • Object
show all
Defined in:
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

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, root = Dry::Core::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.

API:

  • private



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

def initialize(command, root = Dry::Core::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.

API:

  • private



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

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.

API:

  • private



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

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.

API:

  • private



23
24
25
# File 'lib/rom/command_proxy.rb', line 23

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.

API:

  • private



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

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:

API:

  • private



28
29
30
# File 'lib/rom/command_proxy.rb', line 28

def restrictible?
  command.restrictible?
end