class RBS::BuiltinNames::Name

Attributes

name[R]

Public Class Methods

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

Public Instance Methods

instance_type(*args) click to toggle source
# File rbs-1.4.0/lib/rbs/builtin_names.rb, line 14
def instance_type(*args)
  Types::ClassInstance.new(name: name, args: args, location: nil)
end
instance_type?(type) click to toggle source
# File rbs-1.4.0/lib/rbs/builtin_names.rb, line 18
def instance_type?(type)
  type.is_a?(Types::ClassInstance) && type.name == name
end
singleton_type() click to toggle source
# File rbs-1.4.0/lib/rbs/builtin_names.rb, line 22
def singleton_type
  @singleton_type ||= Types::ClassSingleton.new(name: name, location: nil)
end
singleton_type?(type) click to toggle source
# File rbs-1.4.0/lib/rbs/builtin_names.rb, line 26
def singleton_type?(type)
  type.is_a?(Types::ClassSingleton) && type.name == name
end
to_s() click to toggle source
# File rbs-1.4.0/lib/rbs/builtin_names.rb, line 10
def to_s
  name.to_s
end