class RBS::Types::UntypedFunction
Attributes
Public Class Methods
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1244 def initialize(return_type:) @return_type = return_type end
Public Instance Methods
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1326 def ==(other) other.is_a?(UntypedFunction) && other.return_type == return_type end
Also aliased as: eql?
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1274 def each_param(&block) if block # noop else enum_for :each_param end end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1266 def each_type(&block) if block yield return_type else enum_for :each_type end end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1248 def free_variables(acc = Set.new) return_type.free_variables(acc) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1310 def has_classish_type? return_type.has_classish_type? end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1306 def has_self_type? return_type.has_self_type? end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1332 def hash self.class.hash ^ return_type.hash end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1252 def map_type(&block) if block update(return_type: yield(return_type)) else enum_for :map_type end end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1260 def map_type_name(&block) UntypedFunction.new( return_type: return_type.map_type_name(&block) ) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1318 def param_to_s "?" end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1322 def return_to_s return_type.to_s(1) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1288 def sub(subst) return self if subst.empty? map_type { _1.sub(subst) } end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1282 def to_json(state = _ = nil) { return_type: return_type }.to_json(state) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1298 def update(return_type: self.return_type) UntypedFunction.new(return_type: return_type) end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1314 def with_nonreturn_void? false end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/types.rb, line 1294 def with_return_type(ty) update(return_type: ty) end