Class: RBS::Inline::AST::Annotations::TypeAssertion
- Defined in:
- lib/rbs/inline/ast/annotations.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
: Types::t.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(tree, source) ⇒ TypeAssertion
constructor
A new instance of TypeAssertion.
-
#type_source ⇒ Object
: String.
Constructor Details
#initialize(tree, source) ⇒ TypeAssertion
Returns a new instance of TypeAssertion.
328 329 330 331 332 333 |
# File 'lib/rbs/inline/ast/annotations.rb', line 328 def initialize(tree, source) @source = source @tree = tree @type = tree.nth_type!(1) end |
Instance Attribute Details
#type ⇒ Object (readonly)
: Types::t
325 326 327 |
# File 'lib/rbs/inline/ast/annotations.rb', line 325 def type @type end |
Instance Method Details
#type_source ⇒ Object
: String
335 336 337 |
# File 'lib/rbs/inline/ast/annotations.rb', line 335 def type_source #: String type.location&.source || raise end |