123456789_123456789_123456789_123456789_123456789_

Class: RBS::AST::Declarations::AliasDecl

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
self, Base
Inherits: RBS::AST::Declarations::Base
Defined in: lib/rbs/ast/declarations.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(new_name:, old_name:, location:, comment:) ⇒ AliasDecl

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 422

def initialize(new_name:, old_name:, location:, comment:)
  @new_name = new_name
  @old_name = old_name
  @location = location
  @comment = comment
end

Instance Attribute Details

#comment (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 420

attr_reader :new_name, :old_name, :location, :comment

#location (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 420

attr_reader :new_name, :old_name, :location, :comment

#new_name (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 420

attr_reader :new_name, :old_name, :location, :comment

#old_name (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 420

attr_reader :new_name, :old_name, :location, :comment

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 429

def ==(other)
  other.is_a?(self.class) &&
    other.new_name == new_name &&
    other.old_name == old_name
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 435

alias eql? ==

#hash

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 437

def hash
  self.class.hash ^ new_name.hash ^ old_name.hash
end