Class: Cel::Identifier

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/cel/ast/elements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier) ⇒ Identifier

Returns a new instance of Identifier.



14
15
16
17
18
# File 'lib/cel/ast/elements.rb', line 14

def initialize(identifier)
  @id = identifier
  @type = TYPES[:any]
  super(@id)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/cel/ast/elements.rb', line 10

def id
  @id
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/cel/ast/elements.rb', line 12

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



20
21
22
# File 'lib/cel/ast/elements.rb', line 20

def ==(other)
  super || other.to_s == @id.to_s
end