Class: RBS::AST::Ruby::Annotations::ModuleSelfAnnotation
- Defined in:
- lib/rbs/ast/ruby/annotations.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#args_comma_locations ⇒ Object
readonly
Returns the value of attribute args_comma_locations.
-
#close_bracket_location ⇒ Object
readonly
Returns the value of attribute close_bracket_location.
-
#colon_location ⇒ Object
readonly
Returns the value of attribute colon_location.
-
#comment_location ⇒ Object
readonly
Returns the value of attribute comment_location.
-
#keyword_location ⇒ Object
readonly
Returns the value of attribute keyword_location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#open_bracket_location ⇒ Object
readonly
Returns the value of attribute open_bracket_location.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(location:, prefix_location:, keyword_location:, colon_location:, name:, args:, open_bracket_location:, close_bracket_location:, args_comma_locations:, comment_location:) ⇒ ModuleSelfAnnotation
constructor
A new instance of ModuleSelfAnnotation.
- #map_type_name ⇒ Object
- #type_fingerprint ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(location:, prefix_location:, keyword_location:, colon_location:, name:, args:, open_bracket_location:, close_bracket_location:, args_comma_locations:, comment_location:) ⇒ ModuleSelfAnnotation
Returns a new instance of ModuleSelfAnnotation.
359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 359 def initialize(location:, prefix_location:, keyword_location:, colon_location:, name:, args:, open_bracket_location:, close_bracket_location:, args_comma_locations:, comment_location:) super(location, prefix_location) @keyword_location = keyword_location @colon_location = colon_location @name = name @args = args @open_bracket_location = open_bracket_location @close_bracket_location = close_bracket_location @args_comma_locations = args_comma_locations @comment_location = comment_location end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def args @args end |
#args_comma_locations ⇒ Object (readonly)
Returns the value of attribute args_comma_locations.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def args_comma_locations @args_comma_locations end |
#close_bracket_location ⇒ Object (readonly)
Returns the value of attribute close_bracket_location.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def close_bracket_location @close_bracket_location end |
#colon_location ⇒ Object (readonly)
Returns the value of attribute colon_location.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def colon_location @colon_location end |
#comment_location ⇒ Object (readonly)
Returns the value of attribute comment_location.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def comment_location @comment_location end |
#keyword_location ⇒ Object (readonly)
Returns the value of attribute keyword_location.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def keyword_location @keyword_location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def name @name end |
#open_bracket_location ⇒ Object (readonly)
Returns the value of attribute open_bracket_location.
357 358 359 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 357 def open_bracket_location @open_bracket_location end |
Instance Method Details
#map_type_name ⇒ Object
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 371 def map_type_name mapped_args = args.map { |type| type.map_type_name { yield _1 } } self.class.new( location:, prefix_location:, keyword_location:, colon_location:, name: yield(name), args: mapped_args, open_bracket_location:, close_bracket_location:, args_comma_locations:, comment_location: ) #: self end |
#type_fingerprint ⇒ Object
388 389 390 391 392 393 394 395 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 388 def type_fingerprint [ "annots/module_self", name.to_s, args.map(&:to_s), comment_location&.source ] end |