Class: Cel::Identifier
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Cel::Identifier
- Defined in:
- lib/cel/ast/elements/identifier.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(identifier, package = nil) ⇒ Identifier
constructor
A new instance of Identifier.
- #to_s ⇒ Object (also: #to_ruby_type)
- #try_convert_to_proto_type ⇒ Object
Constructor Details
#initialize(identifier, package = nil) ⇒ Identifier
11 12 13 14 15 16 |
# File 'lib/cel/ast/elements/identifier.rb', line 11 def initialize(identifier, package = nil) @id = identifier @type = TYPES[:any] @package = package super(@id) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/cel/ast/elements/identifier.rb', line 7 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/cel/ast/elements/identifier.rb', line 9 def type @type end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/cel/ast/elements/identifier.rb', line 18 def ==(other) super || other.to_s == @id.to_s end |
#to_s ⇒ Object Also known as: to_ruby_type
22 23 24 |
# File 'lib/cel/ast/elements/identifier.rb', line 22 def to_s @id.to_s end |
#try_convert_to_proto_type ⇒ Object
28 29 30 |
# File 'lib/cel/ast/elements/identifier.rb', line 28 def try_convert_to_proto_type Protobuf.convert_to_proto_type(@id.to_s, @package) end |