Class: RBS::AST::Ruby::Declarations::ClassDecl::SuperClass
- Inherits:
-
Object
- Object
- RBS::AST::Ruby::Declarations::ClassDecl::SuperClass
- Defined in:
- lib/rbs/ast/ruby/declarations.rb
Instance Attribute Summary collapse
-
#operator_location ⇒ Object
readonly
Returns the value of attribute operator_location.
-
#type_annotation ⇒ Object
readonly
Returns the value of attribute type_annotation.
-
#type_name ⇒ Object
(also: #name)
readonly
Returns the value of attribute type_name.
-
#type_name_location ⇒ Object
readonly
Returns the value of attribute type_name_location.
Instance Method Summary collapse
-
#initialize(type_name_location, operator_location, type_name, type_annotation) ⇒ SuperClass
constructor
A new instance of SuperClass.
- #location ⇒ Object
- #type_args ⇒ Object (also: #args)
- #type_fingerprint ⇒ Object
Constructor Details
#initialize(type_name_location, operator_location, type_name, type_annotation) ⇒ SuperClass
Returns a new instance of SuperClass.
28 29 30 31 32 33 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 28 def initialize(type_name_location, operator_location, type_name, type_annotation) @type_name_location = type_name_location @operator_location = operator_location @type_name = type_name @type_annotation = type_annotation end |
Instance Attribute Details
#operator_location ⇒ Object (readonly)
Returns the value of attribute operator_location.
22 23 24 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 22 def operator_location @operator_location end |
#type_annotation ⇒ Object (readonly)
Returns the value of attribute type_annotation.
26 27 28 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 26 def type_annotation @type_annotation end |
#type_name ⇒ Object (readonly) Also known as: name
Returns the value of attribute type_name.
24 25 26 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 24 def type_name @type_name end |
#type_name_location ⇒ Object (readonly)
Returns the value of attribute type_name_location.
20 21 22 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 20 def type_name_location @type_name_location end |
Instance Method Details
#location ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 43 def location if type_annotation Location.new( type_name_location.buffer, type_name_location.start_pos, type_annotation.location.end_pos ) else type_name_location end end |
#type_args ⇒ Object Also known as: args
35 36 37 38 39 40 41 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 35 def type_args if type_annotation type_annotation.type_args else [] end end |
#type_fingerprint ⇒ Object
58 59 60 61 62 63 |
# File 'lib/rbs/ast/ruby/declarations.rb', line 58 def type_fingerprint [ type_name.to_s, type_annotation&.type_fingerprint ] end |