class RBS::BuiltinNames::Name

Attributes

name[R]

Public Class Methods

define(name, namespace: Namespace.root) click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 32
def self.define(name, namespace: Namespace.root)
  new(name: TypeName.new(name: name, namespace: namespace))
end
new(name:) click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 8
def initialize(name:)
  @name = name
end

Public Instance Methods

instance_type(*args) click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 16
def instance_type(*args)
  Types::ClassInstance.new(name: name, args: args, location: nil)
end
instance_type?(type) click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 20
def instance_type?(type)
  type.is_a?(Types::ClassInstance) && type.name == name
end
singleton_type() click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 24
def singleton_type
  @singleton_type ||= Types::ClassSingleton.new(name: name, location: nil)
end
singleton_type?(type) click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 28
def singleton_type?(type)
  type.is_a?(Types::ClassSingleton) && type.name == name
end
to_s() click to toggle source
# File rbs-3.7.0/lib/rbs/builtin_names.rb, line 12
def to_s
  name.to_s
end