Class: Kapusta::GeneratedSym
- Inherits:
-
Sym
- Object
- Sym
- Kapusta::GeneratedSym
show all
- Defined in:
- lib/kapusta/ast.rb
Instance Attribute Summary collapse
Attributes inherited from Sym
#name
Instance Method Summary
collapse
Methods inherited from Sym
#dotted?, #segments, #to_s
Constructor Details
Returns a new instance of GeneratedSym.
52
53
54
55
|
# File 'lib/kapusta/ast.rb', line 52
def initialize(name, id)
super(name)
@id = id
end
|
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
50
51
52
|
# File 'lib/kapusta/ast.rb', line 50
def id
@id
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
61
62
63
|
# File 'lib/kapusta/ast.rb', line 61
def ==(other)
other.is_a?(GeneratedSym) && other.id == @id
end
|
#binding_key ⇒ Object
70
71
72
|
# File 'lib/kapusta/ast.rb', line 70
def binding_key
[self.class, @id]
end
|
#hash ⇒ Object
66
67
68
|
# File 'lib/kapusta/ast.rb', line 66
def hash
[self.class, @id].hash
end
|
#inspect ⇒ Object
57
58
59
|
# File 'lib/kapusta/ast.rb', line 57
def inspect
"#<GeneratedSym #{@name} #{@id}>"
end
|