In Files

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

Class/Module Index [+]

Quicksearch

RBS::Types::Block

Attributes

required[R]
type[R]

Public Class Methods

new(type:, required:) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 958
def initialize(type,, required))
  @type = type
  @required = required ? true : false
end
            

Public Instance Methods

==(other) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 963
def ==(other)
  other.is_a?(Block) &&
    other.type == type &&
    other.required == required
end
            
map_type(&block) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 983
def map_type(&block)
  Block.new(
    required: required,
    type: type.map_type(&block)
  )
end
            
sub(s) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 976
def sub(s)
  self.class.new(
    type: type.sub(s),
    required: required
  )
end
            
to_json(*a) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/types.rb, line 969
def to_json(*a)
  {
    type: type,
    required: required
  }.to_json(*a)
end