class RBS::Types::Block
属性
required[R]
self_type[R]
type[R]
公共类方法
new(type:, required:, self_type: nil) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1312 def initialize(type:, required:, self_type: nil) @type = type @required = required ? true : false @self_type = self_type end
公共实例方法
==(other) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1318 def ==(other) other.is_a?(Block) && other.type == type && other.required == required && other.self_type == self_type end
map_type() { |self_type| ... } 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1341 def map_type(&block) Block.new( required: required, type: type.map_type(&block), self_type: self_type ? yield(self_type) : nil ) end
sub(s) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1333 def sub(s) self.class.new( type: type.sub(s), required: required, self_type: self_type&.sub(s) ) end
to_json(state = _ = nil) 点击切换源代码
# File rbs-3.8.0/lib/rbs/types.rb, line 1325 def to_json(state = _ = nil) { type: type, required: required, self_type: self_type }.to_json(state) end