Method: YARD::Handlers::Ruby::Base.method_call

Defined in:
lib/yard/handlers/ruby/base.rb

.method_call(name = nil) ⇒ void

This method returns an undefined value.

Matcher for handling any type of method call. Method calls can be expressed by many Parser::Ruby::AstNode types depending on the syntax with which it is called, so YARD allows you to use this matcher to simplify matching a method call.

Examples:

Match the “describe” method call

handles method_call(:describe)

# The following will be matched:
# describe(...)
# object.describe(...)
# describe "argument" do ... end

Parameters:

  • name (#to_s) (defaults to: nil)

    matches the method call of this name

[View source]

83
84
85
# File 'lib/yard/handlers/ruby/base.rb', line 83

def method_call(name = nil)
  MethodCallWrapper.new(name ? name.to_s : nil)
end