Class: RBS::Definition::Ancestor::Singleton
- Inherits:
-
Object
- Object
- RBS::Definition::Ancestor::Singleton
- Defined in:
- lib/rbs/definition.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(name:) ⇒ Singleton
constructor
A new instance of Singleton.
Constructor Details
#initialize(name:) ⇒ Singleton
Returns a new instance of Singleton.
215 216 217 |
# File 'lib/rbs/definition.rb', line 215 def initialize(name:) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
213 214 215 |
# File 'lib/rbs/definition.rb', line 213 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
219 220 221 |
# File 'lib/rbs/definition.rb', line 219 def ==(other) other.is_a?(Singleton) && other.name == name end |
#hash ⇒ Object
225 226 227 |
# File 'lib/rbs/definition.rb', line 225 def hash self.class.hash ^ name.hash end |