class RBS::AST::Members::MethodDefinition::Overload

Attributes

annotations[R]
method_type[R]

Public Class Methods

new(method_type:, annotations:) click to toggle source
# File rbs-3.7.0/lib/rbs/ast/members.rb, line 13
def initialize(method_type:, annotations:)
  @method_type = method_type
  @annotations = annotations
end

Public Instance Methods

==(other) click to toggle source
# File rbs-3.7.0/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?(other)
Alias for: ==
hash() click to toggle source
# File rbs-3.7.0/lib/rbs/ast/members.rb, line 22
def hash
  method_type.hash ^ annotations.hash
end
sub(subst) click to toggle source
# File rbs-3.7.0/lib/rbs/ast/members.rb, line 32
def sub(subst)
  update(method_type: self.method_type.sub(subst))
end
to_json(state = _ = nil) click to toggle source
# File rbs-3.7.0/lib/rbs/ast/members.rb, line 36
def to_json(state = _ = nil)
  {
    annotations: annotations,
    method_type: method_type
  }.to_json(state)
end
update(annotations: self.annotations, method_type: self.method_type) click to toggle source
# File rbs-3.7.0/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