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.



27
28
29
30
31
# File 'lib/cel/ast/elements.rb', line 27

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



23
24
25
# File 'lib/cel/ast/elements.rb', line 23

def id
  @id
end

#typeObject

Returns the value of attribute type.



25
26
27
# File 'lib/cel/ast/elements.rb', line 25

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



33
34
35
# File 'lib/cel/ast/elements.rb', line 33

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

#to_sObject



37
38
39
# File 'lib/cel/ast/elements.rb', line 37

def to_s
  @id.to_s
end