Class: JMESPath::Nodes::Expression Private

Inherits:
Node
  • Object
show all
Defined in:
lib/jmespath/nodes/expression.rb

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#chains_with?, #hash_like?

Constructor Details

#initialize(expression) ⇒ Expression

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 Expression


7
8
9
# File 'lib/jmespath/nodes/expression.rb', line 7

def initialize(expression)
  @expression = expression
end

Instance Attribute Details

#expressionObject (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.


5
6
7
# File 'lib/jmespath/nodes/expression.rb', line 5

def expression
  @expression
end

Instance Method Details

#eval(value) ⇒ 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.


15
16
17
# File 'lib/jmespath/nodes/expression.rb', line 15

def eval(value)
  @expression.visit(value)
end

#optimizeObject

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.


19
20
21
# File 'lib/jmespath/nodes/expression.rb', line 19

def optimize
  self.class.new(@expression.optimize)
end

#visit(value) ⇒ 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.


11
12
13
# File 'lib/jmespath/nodes/expression.rb', line 11

def visit(value)
  self
end