class RBS::Types::Block
Attributes
Public Class Methods
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1344 def initialize(location: nil, type:, required:, self_type: nil) @location = location @type = type @required = required ? true : false @self_type = self_type end
Public Instance Methods
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1351 def ==(other) other.is_a?(Block) && other.type == type && other.required == required && other.self_type == self_type end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1376 def map_type(&block) Block.new( required: required, type: type.map_type(&block), self_type: self_type ? yield(self_type) : nil ) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1366 def sub(s) return self if s.empty? self.class.new( type: type.sub(s), required: required, self_type: self_type&.sub(s) ) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1358 def to_json(state = _ = nil) { type: type, required: required, self_type: self_type }.to_json(state) end