Class: JMESPath::Token Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/jmespath/token.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.

Constant Summary collapse

NULL_TOKEN =

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

Token.new(:eof, '', nil)
BINDING_POWER =

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

binding power

{
  :eof               => 0,
  :quoted_identifier => 0,
  :identifier        => 0,
  :rbracket          => 0,
  :rparen            => 0,
  :comma             => 0,
  :rbrace            => 0,
  :number            => 0,
  :current           => 0,
  :expref            => 0,
  :pipe              => 1,
  :comparator        => 2,
  :or                => 5,
  :flatten           => 6,
  :star              => 20,
  :dot               => 40,
  :lbrace            => 50,
  :filter            => 50,
  :lbracket          => 50,
  :lparen            => 60,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value, position) ⇒ Token

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 Token.

Parameters:

  • type (Symbol)
  • value (Mixed)
  • position (Integer)


36
37
38
# File 'lib/jmespath/token.rb', line 36

def initialize(type, value, position)
  super(type, value, position, BINDING_POWER[type])
end

Instance Attribute Details

#binding_powerObject

Returns the value of attribute binding_power

Returns:

  • (Object)

    the current value of binding_power



3
4
5
# File 'lib/jmespath/token.rb', line 3

def binding_power
  @binding_power
end

#positionObject

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



3
4
5
# File 'lib/jmespath/token.rb', line 3

def position
  @position
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/jmespath/token.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



3
4
5
# File 'lib/jmespath/token.rb', line 3

def value
  @value
end