class RBS::Types::ClassInstance
ClassInstance represents a type of an instance of a class.
String # Type of an instance of String class. Array # Type of an instance of Array class with instances of String. Kernel # Type of an instance of a class which includes Kernel.
Attributes
location
[R]
loc?
Public Class Methods
Public Instance Methods
() { (t) → t } → ClassInstance
() → Enumerator[t, ClassInstance]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 397 def map_type(&block) if block ClassInstance.new( name: name, args: args.map {|type| yield type }, location: location ) else enum_for :map_type end end
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 389 def map_type_name(&block) ClassInstance.new( name: yield(name, location, self), args: args.map {|type| type.map_type_name(&block) }, location: location ) end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 381 def sub(s) return self if s.empty? self.class.new(name: name, args: args.map {|ty| ty.sub(s) }, location: location) end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 377 def to_json(state = nil) { class: :class_instance, name: name, args: args, location: location }.to_json(state) end