Class: RBS::Inline::AST::Annotations::MethodTypeAssertion

Inherits:
Base
  • Object
show all
Defined in:
lib/rbs/inline/ast/annotations.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#source, #tree

Instance Method Summary collapse

Constructor Details

#initialize(tree, source) ⇒ MethodTypeAssertion

Returns a new instance of MethodTypeAssertion.



312
313
314
315
316
317
# File 'lib/rbs/inline/ast/annotations.rb', line 312

def initialize(tree, source)
  @source = source
  @tree = tree

  @method_type = tree.nth_method_type!(1)
end

Instance Attribute Details

#method_typeObject (readonly)

: MethodType



309
310
311
# File 'lib/rbs/inline/ast/annotations.rb', line 309

def method_type
  @method_type
end

Instance Method Details

#type_sourceObject

: String



319
320
321
# File 'lib/rbs/inline/ast/annotations.rb', line 319

def type_source #: String
  method_type.location&.source || raise
end