123456789_123456789_123456789_123456789_123456789_

Class: RBS::Definition::Ancestor::Singleton

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/definition.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(name:) ⇒ Singleton

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 213

def initialize(name:)
  @name = name
end

Instance Attribute Details

#name (readonly)

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 211

attr_reader :name

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 217

def ==(other)
  other.is_a?(Singleton) && other.name == name
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 221

alias eql? ==

#hash

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 223

def hash
  self.class.hash ^ name.hash
end