Class: RBS::AST::Members::MethodDefinition::Overload
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/ast/members.rb |
Class Method Summary
- .new(method_type:, annotations:) ⇒ Overload constructor
Instance Attribute Summary
- #annotations readonly
- #method_type readonly
Instance Method Summary
Constructor Details
.new(method_type:, annotations:) ⇒ Overload
# File 'lib/rbs/ast/members.rb', line 13
def initialize(method_type:, annotations:) @method_type = method_type @annotations = annotations end
Instance Attribute Details
#annotations (readonly)
[ GitHub ]# File 'lib/rbs/ast/members.rb', line 11
attr_reader :method_type, :annotations
#method_type (readonly)
[ GitHub ]# File 'lib/rbs/ast/members.rb', line 11
attr_reader :method_type, :annotations
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]# File 'lib/rbs/ast/members.rb', line 18
def ==(other) other.is_a?(Overload) && other.method_type == method_type && other.annotations == annotations end
#eql?(other)
[ GitHub ]# File 'lib/rbs/ast/members.rb', line 26
alias eql? ==
#hash
[ GitHub ]# File 'lib/rbs/ast/members.rb', line 22
def hash method_type.hash ^ annotations.hash end
#sub(subst)
[ GitHub ]# File 'lib/rbs/ast/members.rb', line 32
def sub(subst) update(method_type: self.method_type.sub(subst)) end
#to_json(state = _ = nil)
[ GitHub ]# File '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)
[ GitHub ]# File '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