Class: RBS::Types::Proc
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/types.rb |
Class Method Summary
- .new(location:, type:, block:) ⇒ Proc constructor
Instance Attribute Summary
Instance Method Summary
Constructor Details
.new(location:, type:, block:) ⇒ Proc
Instance Attribute Details
#block (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 995
attr_reader :block
#location (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 996
attr_reader :location
#type (readonly)
[ GitHub ]# File 'lib/rbs/types.rb', line 994
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 1008
alias eql? ==
#free_variables(set = )
[ GitHub ]#hash
[ 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 1033
def to_s(level = 0) case when b = block if b.required "^(#{type.param_to_s}) { (#{b.type.param_to_s}) -> #{b.type.return_to_s} } -> #{type.return_to_s}" else "^(#{type.param_to_s}) ?{ (#{b.type.param_to_s}) -> #{b.type.return_to_s} } -> #{type.return_to_s}" end else "^(#{type.param_to_s}) -> #{type.return_to_s}" end end