class RBS::Types::ClassSingleton
Attributes
location[R]
name[R]
Public Class Methods
new(name:, location:)
click to toggle source
# File rbs-2.7.0/lib/rbs/types.rb, line 171 def initialize(name:, location:) @name = name @location = location end
Public Instance Methods
==(other)
click to toggle source
# File rbs-2.7.0/lib/rbs/types.rb, line 176 def ==(other) other.is_a?(ClassSingleton) && other.name == name end
Also aliased as: eql?
hash()
click to toggle source
# File rbs-2.7.0/lib/rbs/types.rb, line 182 def hash self.class.hash ^ name.hash end
map_type_name() { |name, location, self| ... }
click to toggle source
# File rbs-2.7.0/lib/rbs/types.rb, line 199 def map_type_name ClassSingleton.new( name: yield(name, location, self), location: location ) end
to_json(state = _ = nil)
click to toggle source
# File rbs-2.7.0/lib/rbs/types.rb, line 189 def to_json(state = _ = nil) { class: :class_singleton, name: name, location: location }.to_json(state) end
to_s(level = 0)
click to toggle source
# File rbs-2.7.0/lib/rbs/types.rb, line 193 def to_s(level = 0) "singleton(#{name})" end