Class: YARD::Handlers::Ruby::MethodCallWrapper

Inherits:
HandlesExtension show all
Defined in:
lib/yard/handlers/ruby/base.rb

Instance Attribute Summary

Attributes inherited from HandlesExtension

#name

Instance Method Summary collapse

Methods inherited from HandlesExtension

#initialize

Constructor Details

This class inherits a constructor from YARD::Handlers::Ruby::HandlesExtension

Instance Method Details

#matches?(node) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/yard/handlers/ruby/base.rb', line 35

def matches?(node)
  case node.type
  when :var_ref
    if !node.parent || node.parent.type == :list
      return true if node[0].type == :ident && node[0][0] == name
    end
  when :fcall, :command
    return true if node[0][0] == name
  when :call, :command_call
    return true if node[2][0] == name
  end
  false
end