Class: RBS::BuiltinNames::Name
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/builtin_names.rb |
Class Method Summary
Instance Attribute Summary
- #name readonly
Instance Method Summary
Constructor Details
.new(name:) ⇒ Name
# File 'lib/rbs/builtin_names.rb', line 6
def initialize(name:) @name = name end
Class Method Details
.define(name, namespace: Namespace.root)
[ GitHub ]Instance Attribute Details
#name (readonly)
[ GitHub ]# File 'lib/rbs/builtin_names.rb', line 4
attr_reader :name
Instance Method Details
#instance_type(*args)
[ GitHub ]# File 'lib/rbs/builtin_names.rb', line 14
def instance_type(*args) Types::ClassInstance.new(name: name, args: args, location: nil) end
#instance_type?(type) ⇒ Boolean
# File 'lib/rbs/builtin_names.rb', line 18
def instance_type?(type) type.is_a?(Types::ClassInstance) && type.name == name end
#singleton_type
[ GitHub ]# File 'lib/rbs/builtin_names.rb', line 22
def singleton_type @singleton_type ||= Types::ClassSingleton.new(name: name, location: nil) end
#singleton_type?(type) ⇒ Boolean
# File 'lib/rbs/builtin_names.rb', line 26
def singleton_type?(type) type.is_a?(Types::ClassSingleton) && type.name == name end
#to_s
[ GitHub ]# File 'lib/rbs/builtin_names.rb', line 10
def to_s name.to_s end