Class: RBS::AST::Ruby::Annotations::TypeApplicationAnnotation
- Defined in:
- lib/rbs/ast/ruby/annotations.rb
Instance Attribute Summary collapse
-
#close_bracket_location ⇒ Object
readonly
Returns the value of attribute close_bracket_location.
-
#comma_locations ⇒ Object
readonly
Returns the value of attribute comma_locations.
-
#type_args ⇒ Object
readonly
Returns the value of attribute type_args.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:) ⇒ TypeApplicationAnnotation
constructor
A new instance of TypeApplicationAnnotation.
- #map_type_name(&block) ⇒ Object
- #type_fingerprint ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:) ⇒ TypeApplicationAnnotation
Returns a new instance of TypeApplicationAnnotation.
195 196 197 198 199 200 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 195 def initialize(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:) super(location, prefix_location) @type_args = type_args @close_bracket_location = close_bracket_location @comma_locations = comma_locations end |
Instance Attribute Details
#close_bracket_location ⇒ Object (readonly)
Returns the value of attribute close_bracket_location.
193 194 195 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 193 def close_bracket_location @close_bracket_location end |
#comma_locations ⇒ Object (readonly)
Returns the value of attribute comma_locations.
193 194 195 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 193 def comma_locations @comma_locations end |
#type_args ⇒ Object (readonly)
Returns the value of attribute type_args.
193 194 195 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 193 def type_args @type_args end |
Instance Method Details
#map_type_name(&block) ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 202 def map_type_name(&block) mapped_type_args = type_args.map { |type| type.map_type_name { yield _1 } } self.class.new( location:, prefix_location:, type_args: mapped_type_args, close_bracket_location:, comma_locations: ) #: self end |
#type_fingerprint ⇒ Object
214 215 216 217 218 219 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 214 def type_fingerprint [ "annots/type_application", type_args.map(&:to_s) ] end |