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.



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

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

  @method_type = tree.nth_method_type!(1)
end

Instance Attribute Details

#method_typeObject (readonly)

: MethodType



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

def method_type
  @method_type
end

Instance Method Details

#type_sourceObject

: String



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

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