class RBS::AST::Members::Alias

Attributes

annotations[R]
comment[R]
kind[R]
location[R]
new_name[R]
old_name[R]

Public Class Methods

new(new_name:, old_name:, kind:, annotations:, location:, comment:) click to toggle source
# File rbs-2.7.0/lib/rbs/ast/members.rb, line 371
def initialize(new_name:, old_name:, kind:, annotations:, location:, comment:)
  @new_name = new_name
  @old_name = old_name
  @kind = kind
  @annotations = annotations
  @location = location
  @comment = comment
end

Public Instance Methods

==(other) click to toggle source
# File rbs-2.7.0/lib/rbs/ast/members.rb, line 380
def ==(other)
  other.is_a?(self.class) &&
    other.new_name == new_name &&
    other.old_name == old_name &&
    other.kind == kind
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File rbs-2.7.0/lib/rbs/ast/members.rb, line 389
def hash
  new_name.hash ^ old_name.hash ^ kind.hash
end
instance?() click to toggle source
# File rbs-2.7.0/lib/rbs/ast/members.rb, line 405
def instance?
  kind == :instance
end
singleton?() click to toggle source
# File rbs-2.7.0/lib/rbs/ast/members.rb, line 409
def singleton?
  kind == :singleton
end
to_json(state = _ = nil) click to toggle source
# File rbs-2.7.0/lib/rbs/ast/members.rb, line 393
def to_json(state = _ = nil)
  {
    member: :alias,
    new_name: new_name,
    old_name: old_name,
    kind: kind,
    annotations: annotations,
    location: location,
    comment: comment
  }.to_json(state)
end