Class: RBS::AST::Members::Alias
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#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:, kind:, annotations:, location:, comment:) ⇒ Alias
constructor
A new instance of Alias.
- #instance? ⇒ Boolean
- #singleton? ⇒ Boolean
- #to_json(state = _ = nil) ⇒ Object
Constructor Details
#initialize(new_name:, old_name:, kind:, annotations:, location:, comment:) ⇒ Alias
Returns a new instance of Alias.
407 408 409 410 411 412 413 414 |
# File 'lib/rbs/ast/members.rb', line 407 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 |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
403 404 405 |
# File 'lib/rbs/ast/members.rb', line 403 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
405 406 407 |
# File 'lib/rbs/ast/members.rb', line 405 def comment @comment end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
402 403 404 |
# File 'lib/rbs/ast/members.rb', line 402 def kind @kind end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
404 405 406 |
# File 'lib/rbs/ast/members.rb', line 404 def location @location end |
#new_name ⇒ Object (readonly)
Returns the value of attribute new_name.
400 401 402 |
# File 'lib/rbs/ast/members.rb', line 400 def new_name @new_name end |
#old_name ⇒ Object (readonly)
Returns the value of attribute old_name.
401 402 403 |
# File 'lib/rbs/ast/members.rb', line 401 def old_name @old_name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
416 417 418 419 420 421 |
# File 'lib/rbs/ast/members.rb', line 416 def ==(other) other.is_a?(self.class) && other.new_name == new_name && other.old_name == old_name && other.kind == kind end |
#hash ⇒ Object
425 426 427 |
# File 'lib/rbs/ast/members.rb', line 425 def hash new_name.hash ^ old_name.hash ^ kind.hash end |
#instance? ⇒ Boolean
441 442 443 |
# File 'lib/rbs/ast/members.rb', line 441 def instance? kind == :instance end |
#singleton? ⇒ Boolean
445 446 447 |
# File 'lib/rbs/ast/members.rb', line 445 def singleton? kind == :singleton end |
#to_json(state = _ = nil) ⇒ Object
429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/rbs/ast/members.rb', line 429 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 |