Class: Steep::AST::Types::Name::Module
- Inherits:
-
Base
- Object
- Base
- Steep::AST::Types::Name::Module
show all
- Defined in:
- lib/steep/ast/types/name.rb
Instance Attribute Summary
Attributes inherited from Base
#location, #name
Instance Method Summary
collapse
Methods inherited from Base
#free_variables, #initialize, #level, #subst
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
131
132
133
134
|
# File 'lib/steep/ast/types/name.rb', line 131
def ==(other)
other.class == self.class &&
other.name == name
end
|
#hash ⇒ Object
138
139
140
|
# File 'lib/steep/ast/types/name.rb', line 138
def hash
self.class.hash ^ name.hash
end
|
#to_s ⇒ Object
142
143
144
|
# File 'lib/steep/ast/types/name.rb', line 142
def to_s
"singleton(#{name.to_s})"
end
|
#with_location(new_location) ⇒ Object
146
147
148
|
# File 'lib/steep/ast/types/name.rb', line 146
def with_location(new_location)
self.class.new(name: name, location: new_location)
end
|