class RBS::Types::UntypedFunction
Function type without type checking arguments
Attributes
Public Class Methods
(return_type: t) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1254 def initialize(return_type:) @return_type = return_type end
Public Instance Methods
(untyped) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1336 def ==(other) other.is_a?(UntypedFunction) && other.return_type == return_type end
Also aliased as: eql?, eql?
() { (Function::Param) → void } → void
() → Enumerator[Function::Param, void]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1284 def each_param(&block) if block # noop else enum_for :each_param end end
() { (t) → void } → void
() → Enumerator[t, void]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1276 def each_type(&block) if block yield return_type else enum_for :each_type end end
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1312 def empty? true end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1258 def free_variables(acc = Set.new) return_type.free_variables(acc) end
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1320 def has_classish_type? return_type.has_classish_type? end
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1316 def has_self_type? return_type.has_self_type? end
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1342 def hash self.class.hash ^ return_type.hash end
() { (t) → t } → UntypedFunction
() → Enumerator[t, UntypedFunction]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1262 def map_type(&block) if block update(return_type: yield(return_type)) else enum_for :map_type end end
() { (TypeName, Location[untyped, untyped]?, t) → TypeName } → UntypedFunction
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1270 def map_type_name(&block) UntypedFunction.new( return_type: return_type.map_type_name(&block) ) end
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1328 def param_to_s "?" end
Returns ?
() → String
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1332 def return_to_s return_type.to_s(1) end
Returns return_type.to_s(1)
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1298 def sub(subst) return self if subst.empty? map_type { _1.sub(subst) } end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1292 def to_json(state = nil) { return_type: return_type }.to_json(state) end
(?return_type: t) → UntypedFunction
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1308 def update(return_type: self.return_type) UntypedFunction.new(return_type: return_type) end
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1324 def with_nonreturn_void? false end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/types.rb, line 1304 def with_return_type(ty) update(return_type: ty) end