Class: RBS::AST::Ruby::Annotations::NodeTypeAssertion
- Defined in:
- lib/rbs/ast/ruby/annotations.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(location:, prefix_location:, type:) ⇒ NodeTypeAssertion
constructor
A new instance of NodeTypeAssertion.
- #map_type_name ⇒ Object
- #type_fingerprint ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(location:, prefix_location:, type:) ⇒ NodeTypeAssertion
Returns a new instance of NodeTypeAssertion.
23 24 25 26 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 23 def initialize(location:, prefix_location:, type:) super(location, prefix_location) @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
21 22 23 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 21 def type @type end |
Instance Method Details
#map_type_name ⇒ Object
28 29 30 31 32 33 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 28 def map_type_name self.class.new( location:, prefix_location:, type: type.map_type_name { yield _1 } ) #: self end |
#type_fingerprint ⇒ Object
35 36 37 38 39 40 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 35 def type_fingerprint [ "annots/node_type_assertion", type.to_s ] end |