Module: JMESPath::Nodes::TypeChecker Private

Included in:
CompareBy, EndsWithFunction, MaxFunction, MinFunction, SortByFunction, SortFunction, StartsWithFunction, TypeFunction
Defined in:
lib/jmespath/nodes/function.rb

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

Constant Summary collapse

ARRAY_TYPE =

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.

0
BOOLEAN_TYPE =

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.

1
EXPRESSION_TYPE =

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.

2
NULL_TYPE =

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.

3
NUMBER_TYPE =

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.

4
OBJECT_TYPE =

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.

5
STRING_TYPE =

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.

6
TYPE_NAMES =

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.

{
  ARRAY_TYPE => 'array',
  BOOLEAN_TYPE => 'boolean',
  EXPRESSION_TYPE => 'expression',
  NULL_TYPE => 'null',
  NUMBER_TYPE => 'number',
  OBJECT_TYPE => 'object',
  STRING_TYPE => 'string',
}.freeze

Instance Method Summary collapse

Instance Method Details

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


52
53
54
55
56
57
58
59
60
61
62
# File 'lib/jmespath/nodes/function.rb', line 52

def get_type(value)
  case value
  when String then STRING_TYPE
  when true, false then BOOLEAN_TYPE
  when nil then NULL_TYPE
  when Numeric then NUMBER_TYPE
  when Hash, Struct then OBJECT_TYPE
  when Array then ARRAY_TYPE
  when Expression then EXPRESSION_TYPE
  end
end