class YARD::Handlers::Ruby::Base
@see Legacy::Base
@see Handlers::Base
@abstract See {Handlers::Base} for subclassing information.
{Legacy::Base}.
new-style parser is used. For implementing legacy handlers, see
All handlers that subclass this base class will be used when the
This is the base handler class for the new-style (1.9) Ruby parser.
def handles?(node)
-
(Boolean)
- whether or not an {AstNode} object should be
def handles?(node) handlers.any? do |a_handler| case a_handler when Symbol a_handler == node.type when String node.source == a_handler when Regexp node.source =~ a_handler when Parser::Ruby::AstNode a_handler == node when HandlesExtension a_handler.matches?(node) end end end
def meta_type(type)
-
(void)
-
Parameters:
-
type
(Symbol
) -- the meta-type to match. A meta-type can be
Other tags:
- Example: Handling any conditional statement (if, unless) -
def meta_type(type) TestNodeWrapper.new(type.to_s + "?") end
def method_call(name)
-
(void)
-
Parameters:
-
name
(#to_s
) -- matches the method call of this name
Other tags:
- Example: Match the "describe" method call -
def method_call(name) MethodCallWrapper.new(name.to_s) end
def parse_block(inner_node, opts = {})
def parse_block(inner_node, opts = {}) push_state(opts) do nodes = inner_node.type == :list ? inner_node.children : [inner_node] parser.process(nodes) end end