Class: RBS::Types::Proc
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
Instance Attribute Summary
- #block readonly
- #has_classish_type? ⇒ Boolean readonly
- #has_self_type? ⇒ Boolean readonly
- #location readonly
- #self_type readonly
- #type readonly
- #with_nonreturn_void? ⇒ Boolean 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 1351
attr_reader :block
#has_classish_type? ⇒ Boolean
(readonly)
[ GitHub ]
#has_self_type? ⇒ Boolean
(readonly)
[ GitHub ]
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1353
attr_reader :location
#self_type (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1352
attr_reader :self_type
#type (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 1350
attr_reader :type
#with_nonreturn_void? ⇒ Boolean
(readonly)
[ GitHub ]
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]#each_type(&block)
[ GitHub ]#eql?(other)
[ GitHub ]# File 'lib/rbs/types.rb', line 1366
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 1398
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