Class: RBS::AST::Ruby::Annotations::AliasAnnotation
- Defined in:
- lib/rbs/ast/ruby/annotations.rb,
sig/ast/ruby/annotations.rbs
Direct Known Subclasses
Instance Attribute Summary collapse
-
#keyword_location ⇒ Location
readonly
Returns the value of attribute keyword_location.
-
#type_name ⇒ TypeName?
readonly
The name of the module that will be the target of the alias.
-
#type_name_location ⇒ Location?
readonly
Returns the value of attribute type_name_location.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(location:, prefix_location:, keyword_location:, type_name:, type_name_location:) ⇒ AliasAnnotation
constructor
A new instance of AliasAnnotation.
- #map_type_name {|arg0| ... } ⇒ self
Methods inherited from Base
Constructor Details
#initialize(location:, prefix_location:, keyword_location:, type_name:, type_name_location:) ⇒ AliasAnnotation
Returns a new instance of AliasAnnotation.
46 47 48 49 50 51 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 46 def initialize(location:, prefix_location:, keyword_location:, type_name:, type_name_location:) super(location, prefix_location) @keyword_location = keyword_location @type_name = type_name @type_name_location = type_name_location end |
Instance Attribute Details
#keyword_location ⇒ Location (readonly)
Returns the value of attribute keyword_location.
44 45 46 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 44 def keyword_location @keyword_location end |
#type_name ⇒ TypeName? (readonly)
The name of the module that will be the target of the alias
nilif the module/class name is unspecifiedTypeNameobject if the module/class name is specified
62 63 64 |
# File 'sig/ast/ruby/annotations.rbs', line 62 def type_name @type_name end |
#type_name_location ⇒ Location? (readonly)
Returns the value of attribute type_name_location.
44 45 46 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 44 def type_name_location @type_name_location end |
Instance Method Details
#map_type_name {|arg0| ... } ⇒ self
53 54 55 56 57 58 59 60 61 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 53 def map_type_name self.class.new( location:, prefix_location:, keyword_location:, type_name: type_name ? yield(type_name) : nil, type_name_location: ) #: self end |