Class: RBS::AST::Declarations::AliasDecl
- Defined in:
- lib/rbs/ast/declarations.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#new_name ⇒ Object
readonly
Returns the value of attribute new_name.
-
#old_name ⇒ Object
readonly
Returns the value of attribute old_name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(new_name:, old_name:, location:, comment:, annotations: []) ⇒ AliasDecl
constructor
A new instance of AliasDecl.
Constructor Details
#initialize(new_name:, old_name:, location:, comment:, annotations: []) ⇒ AliasDecl
426 427 428 429 430 431 432 |
# File 'lib/rbs/ast/declarations.rb', line 426 def initialize(new_name:, old_name:, location:, comment:, annotations: []) @new_name = new_name @old_name = old_name @location = location @comment = comment @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
424 425 426 |
# File 'lib/rbs/ast/declarations.rb', line 424 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
424 425 426 |
# File 'lib/rbs/ast/declarations.rb', line 424 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
424 425 426 |
# File 'lib/rbs/ast/declarations.rb', line 424 def location @location end |
#new_name ⇒ Object (readonly)
Returns the value of attribute new_name.
424 425 426 |
# File 'lib/rbs/ast/declarations.rb', line 424 def new_name @new_name end |
#old_name ⇒ Object (readonly)
Returns the value of attribute old_name.
424 425 426 |
# File 'lib/rbs/ast/declarations.rb', line 424 def old_name @old_name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
434 435 436 437 438 |
# File 'lib/rbs/ast/declarations.rb', line 434 def ==(other) other.is_a?(self.class) && other.new_name == new_name && other.old_name == old_name end |
#hash ⇒ Object
442 443 444 |
# File 'lib/rbs/ast/declarations.rb', line 442 def hash self.class.hash ^ new_name.hash ^ old_name.hash end |