Class: Arel::Enhance::PathNode

Inherits:
Object
  • Object
show all
Defined in:
lib/arel/enhance/path_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, value) ⇒ PathNode

Returns a new instance of PathNode.



7
8
9
10
# File 'lib/arel/enhance/path_node.rb', line 7

def initialize(method, value)
  @method = method
  @value = value
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



4
5
6
# File 'lib/arel/enhance/path_node.rb', line 4

def method
  @method
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/arel/enhance/path_node.rb', line 5

def value
  @value
end

Instance Method Details

#arguments?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/arel/enhance/path_node.rb', line 12

def arguments?
  method.is_a?(Array)
end

#inspectObject



16
17
18
19
20
21
22
23
# File 'lib/arel/enhance/path_node.rb', line 16

def inspect
  case value
  when String
    "'#{value}'"
  else
    value.inspect
  end
end