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.



16
17
18
19
20
# File 'lib/cel/ast/elements.rb', line 16

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



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

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

#to_sObject



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

def to_s
  @id.to_s
end