Module: Yoda::AST::MethodTraversable

Included in:
Vnode
Defined in:
lib/yoda/ast/method_traversable.rb

Instance Method Summary collapse

Instance Method Details

#calc_current_location_method(location) ⇒ DefNode, ...

Parameters:

  • location (Location)

Returns:



17
18
19
# File 'lib/yoda/ast/method_traversable.rb', line 17

def calc_current_location_method(location)
  positionally_nearest_child(location)&.including_method
end

#including_methodNamespace

Returns:



11
12
13
# File 'lib/yoda/ast/method_traversable.rb', line 11

def including_method
  @including_method ||= method? ? self : parent.including_method
end

#method?true, false

Returns:

  • (true, false)


6
7
8
# File 'lib/yoda/ast/method_traversable.rb', line 6

def method?
  false
end