Class: RBS::AST::Ruby::Annotations::InstanceVariableAnnotation
- Defined in:
- lib/rbs/ast/ruby/annotations.rb
Instance Attribute Summary collapse
-
#colon_location ⇒ Object
readonly
Returns the value of attribute colon_location.
-
#comment_location ⇒ Object
readonly
Returns the value of attribute comment_location.
-
#ivar_name ⇒ Object
readonly
Returns the value of attribute ivar_name.
-
#ivar_name_location ⇒ Object
readonly
Returns the value of attribute ivar_name_location.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:) ⇒ InstanceVariableAnnotation
constructor
A new instance of InstanceVariableAnnotation.
- #map_type_name(&block) ⇒ Object
- #type_fingerprint ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:) ⇒ InstanceVariableAnnotation
Returns a new instance of InstanceVariableAnnotation.
225 226 227 228 229 230 231 232 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 225 def initialize(location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:) super(location, prefix_location) @ivar_name = ivar_name @ivar_name_location = ivar_name_location @colon_location = colon_location @type = type @comment_location = comment_location end |
Instance Attribute Details
#colon_location ⇒ Object (readonly)
Returns the value of attribute colon_location.
223 224 225 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 223 def colon_location @colon_location end |
#comment_location ⇒ Object (readonly)
Returns the value of attribute comment_location.
223 224 225 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 223 def comment_location @comment_location end |
#ivar_name ⇒ Object (readonly)
Returns the value of attribute ivar_name.
223 224 225 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 223 def ivar_name @ivar_name end |
#ivar_name_location ⇒ Object (readonly)
Returns the value of attribute ivar_name_location.
223 224 225 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 223 def ivar_name_location @ivar_name_location end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
223 224 225 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 223 def type @type end |
Instance Method Details
#map_type_name(&block) ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 234 def map_type_name(&block) self.class.new( location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type: type.map_type_name { yield _1 }, comment_location: ) #: self end |
#type_fingerprint ⇒ Object
246 247 248 249 250 251 252 253 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 246 def type_fingerprint [ "annots/instance_variable", ivar_name.to_s, type.to_s, comment_location&.source ] end |