Class | YARD::Handlers::Ruby::Base
In: | lib/yard/handlers/ruby/base.rb
Parent: | Handlers::Base

This is the base handler class for the new-style (1.9) Ruby parser. All handlers that subclass this base class will be used when the new-style parser is used. For implementing legacy handlers, see {Legacy::Base}.

@abstract See {Handlers::Base} for subclassing information. @see Handlers::Base @see Legacy::Base

### Methods

call_params caller_method handles? meta_type method_call parse_block

### Included Modules

Parser::Ruby Parser::Ruby

### Public Class methods

handles?(node)

@return [Boolean] whether or not an {AstNode} object should be

      handled by this handler

meta_type(type)

Matcher for handling a node with a specific meta-type. An {AstNode} has a {AstNode#type} to define its type but can also be associated with a set of types. For instance, +:if+ and +:unless+ are both of the meta-type +:condition+.

A meta-type is any method on the {AstNode} class ending in "?", though you should not include the "?" suffix in your declaration. Some examples are: "condition", "call", "literal", "kw", "token", "ref".

@example Handling any conditional statement (if, unless)

      handles meta_type(:condition)

@param [Symbol] type the meta-type to match. A meta-type can be

      any method name + "?" that {AstNode} responds to.

@return [void]

method_call(name = nil)

Matcher for handling any type of method call. Method calls can be expressed by many {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.

@example Match the "describe" method call

      handles method_call(:describe)

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

@param [to_s] name matches the method call of this name @return [void]

### Public Instance methods

call_params()

@group Macro Handling

caller_method()
parse_block(inner_node, opts = {})

@group Parsing an Inner Block

[Validate]