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 192

def initialize(name:)
  @name = name
end

Instance Attribute Details

#name (readonly)

[ GitHub ]

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

attr_reader :name

Instance Method Details

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

[ GitHub ]

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

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

#eql?(other)

Alias for #==.

[ GitHub ]

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

alias eql? ==

#hash

[ GitHub ]

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

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