Class: Cel::MapType
Instance Attribute Summary collapse
-
#element_type ⇒ Object
Returns the value of attribute element_type.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #cast(value) ⇒ Object
- #get(attrib) ⇒ Object
-
#initialize(type_map) ⇒ MapType
constructor
A new instance of MapType.
Methods inherited from Type
Constructor Details
Instance Attribute Details
#element_type ⇒ Object
Returns the value of attribute element_type.
74 75 76 |
# File 'lib/cel/ast/types.rb', line 74 def element_type @element_type end |
Instance Method Details
#==(other) ⇒ Object
87 88 89 |
# File 'lib/cel/ast/types.rb', line 87 def ==(other) other == :map || super end |
#cast(value) ⇒ Object
91 92 93 |
# File 'lib/cel/ast/types.rb', line 91 def cast(value) Map.new(value) end |
#get(attrib) ⇒ Object
82 83 84 85 |
# File 'lib/cel/ast/types.rb', line 82 def get(attrib) _, value = @type_map.find { |k, _| k == attrib.to_s } value end |