class RBS::Types::Alias - rbs: Ruby Standard Library Documentation

# class RBS::Types::Alias

### Attributes

location[R]

### Public Class Methods

new(name:, args:, location:) click to toggle source

    # File rbs-3.8.0/lib/rbs/types.rb, line 399
    def initialize(name:, args:, location:)
      @name = name
      @args = args
      @location = location
    end

### Public Instance Methods

map_type() { |type| ... } click to toggle source

    # File rbs-3.8.0/lib/rbs/types.rb, line 421
    def map_type(&block)
      if block
        Alias.new(
          name: name,
          args: args.map {|type| yield type },
          location: location
        )
      else
        enum_for :map_type
      end
    end

map_type_name() { |name, location, self| ... } click to toggle source

    # File rbs-3.8.0/lib/rbs/types.rb, line 413
    def map_type_name(&block)
      Alias.new(
        name: yield(name, location, self),
        args: args.map {|arg| arg.map_type_name(&block) },
        location: location
      )
    end

sub(s) click to toggle source

    # File rbs-3.8.0/lib/rbs/types.rb, line 409
    def sub(s)
      Alias.new(name: name, args: args.map {|ty| ty.sub(s) }, location: location)
    end

to_json(state = _ = nil) click to toggle source

    # File rbs-3.8.0/lib/rbs/types.rb, line 405
    def to_json(state = _ = nil)
      { class: :alias, name: name, args: args, location: location }.to_json(state)
    end