class RBS::AST::Members::MethodDefinition::Overload
Attributes
annotations
[R]
Array[Annotation]
Public Class Methods
(method_type: MethodType, annotations: Array[Annotation]) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/members.rb, line 13 def initialize(method_type:, annotations:) @method_type = method_type @annotations = annotations end
Public Instance Methods
(untyped) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/members.rb, line 18 def ==(other) other.is_a?(Overload) && other.method_type == method_type && other.annotations == annotations end
Also aliased as: eql?, eql?
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/members.rb, line 22 def hash method_type.hash ^ annotations.hash end
(Substitution) → Overload
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/members.rb, line 32 def sub(subst) return self if subst.empty? update(method_type: self.method_type.sub(subst)) end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/members.rb, line 38 def to_json(state = nil) { annotations: annotations, method_type: method_type }.to_json(state) end
(?annotations: Array[Annotation], ?method_type: MethodType) → Overload
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/members.rb, line 28 def update(annotations: self.annotations, method_type: self.method_type) Overload.new(annotations: annotations, method_type: method_type) end