Class: RBS::Types::Proc
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
Instance Attribute Summary
- #block readonly
- #location readonly
- #self_type readonly
- #type readonly
Instance Method Summary
Constructor Details
.new(location:, type:, block:, self_type: nil) ⇒ Proc
Instance Attribute Details
#block (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1095
attr_reader :block
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1097
attr_reader :location
#self_type (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1096
attr_reader :self_type
#type (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1094
attr_reader :type
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]#each_type(&block)
[ GitHub ]#eql?(other)
[ GitHub ]# File 'lib/rbs/types.rb', line 1110
alias eql? ==
#free_variables(set = )
[ GitHub ]#hash
[ GitHub ]#map_type(&block)
[ GitHub ]#map_type_name(&block)
[ GitHub ]#sub(s)
[ GitHub ]#to_json(state = _ = nil)
[ GitHub ]#to_s(level = 0)
[ GitHub ]# File 'lib/rbs/types.rb', line 1142
def to_s(level = 0) self_binding = SelfTypeBindingHelper.self_type_binding_to_s(self_type) block_self_binding = SelfTypeBindingHelper.self_type_binding_to_s(block&.self_type) case when b = block if b.required "^(#{type.param_to_s}) #{self_binding}{ (#{b.type.param_to_s}) #{block_self_binding}-> #{b.type.return_to_s} } -> #{type.return_to_s}" else "^(#{type.param_to_s}) #{self_binding}?{ (#{b.type.param_to_s}) #{block_self_binding}-> #{b.type.return_to_s} } -> #{type.return_to_s}" end else "^(#{type.param_to_s}) #{self_binding}-> #{type.return_to_s}" end end