In Files

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

Parent

Included Modules

Class/Module Index [+]

Quicksearch

RBS::Types::ClassInstance

Attributes

location[R]

Public Class Methods

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

Public Instance Methods

map_type(&block) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/types.rb, line 315
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
            
map_type_name(&block) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/types.rb, line 307
def map_type_name(&block)
  ClassInstance.new(
    name: yield(name, location, self),
    args: args.map {|type| type.map_type_name(&block) },
    location: location
  )
end
            
sub(s) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/types.rb, line 301
def sub(s)
  self.class.new(name: name,
                 args: args.map {|ty| ty.sub(s) },
                 location: location)
end
            
to_json(state = _ = nil) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/types.rb, line 297
def to_json(state = _ = nil)
  { class: :class_instance, name: name, args: args, location: location }.to_json(state)
end