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(*a) ⇒ Object
Constructor Details
#initialize(new_name:, old_name:, kind:, annotations:, location:, comment:) ⇒ Alias
Returns a new instance of Alias.
337 338 339 340 341 342 343 344 |
# File 'lib/rbs/ast/members.rb', line 337 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.
333 334 335 |
# File 'lib/rbs/ast/members.rb', line 333 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
335 336 337 |
# File 'lib/rbs/ast/members.rb', line 335 def comment @comment end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
332 333 334 |
# File 'lib/rbs/ast/members.rb', line 332 def kind @kind end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
334 335 336 |
# File 'lib/rbs/ast/members.rb', line 334 def location @location end |
#new_name ⇒ Object (readonly)
Returns the value of attribute new_name.
330 331 332 |
# File 'lib/rbs/ast/members.rb', line 330 def new_name @new_name end |
#old_name ⇒ Object (readonly)
Returns the value of attribute old_name.
331 332 333 |
# File 'lib/rbs/ast/members.rb', line 331 def old_name @old_name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
346 347 348 349 350 351 |
# File 'lib/rbs/ast/members.rb', line 346 def ==(other) other.is_a?(self.class) && other.new_name == new_name && other.old_name == old_name && other.kind == kind end |
#hash ⇒ Object
355 356 357 |
# File 'lib/rbs/ast/members.rb', line 355 def hash self.class.hash ^ new_name.hash ^ old_name.hash ^ kind.hash end |
#instance? ⇒ Boolean
371 372 373 |
# File 'lib/rbs/ast/members.rb', line 371 def instance? kind == :instance end |
#singleton? ⇒ Boolean
375 376 377 |
# File 'lib/rbs/ast/members.rb', line 375 def singleton? kind == :singleton end |
#to_json(*a) ⇒ Object
359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/rbs/ast/members.rb', line 359 def to_json(*a) { member: :alias, new_name: new_name, old_name: old_name, kind: kind, annotations: annotations, location: location, comment: comment }.to_json(*a) end |