class RBS::AST::Members::Alias

属性

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

公共类方法

new(new_name:, old_name:, kind:, annotations:, location:, comment:) 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/members.rb, line 405
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

公共实例方法

==(other) 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/members.rb, line 414
def ==(other)
  other.is_a?(self.class) &&
    other.new_name == new_name &&
    other.old_name == old_name &&
    other.kind == kind
end
也别名为:eql?
eql?(other)
别名为:==
hash() 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/members.rb, line 423
def hash
  new_name.hash ^ old_name.hash ^ kind.hash
end
instance?() 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/members.rb, line 439
def instance?
  kind == :instance
end
singleton?() 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/members.rb, line 443
def singleton?
  kind == :singleton
end
to_json(state = _ = nil) 点击切换源代码
# File rbs-3.8.0/lib/rbs/ast/members.rb, line 427
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