In Files

  • rbs-1.0.4/lib/rbs/types.rb

Class/Module Index [+]

Quicksearch

RBS::Types::ClassSingleton

Attributes

location[R]
name[R]

Public Class Methods

new(name:, location:) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 162
def initialize(name,, location))
  @name = name
  @location = location
end
            

Public Instance Methods

==(other) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 167
def ==(other)
  other.is_a?(ClassSingleton) && other.name == name
end
            
Also aliased as: eql?
eql?(other) click to toggle source
Alias for: ==
hash() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 173
def hash
  self.class.hash ^ name.hash
end
            
map_type_name() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 190
def map_type_name
  ClassSingleton.new(
    name: yield(name, location, self),
    location: location
  )
end
            
to_json(*a) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 180
def to_json(*a)
  { class: :class_singleton, name: name, location: location }.to_json(*a)
end
            
to_s(level = 0) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 184
def to_s(level = 0)
  "singleton(#{name})"
end