Fix all yard docs
This commit is contained in:
parent
7ae6e09908
commit
c6d1c3c0c8
5 changed files with 60 additions and 6 deletions
|
@ -170,7 +170,7 @@ module Mutant
|
|||
@strategy = strategy
|
||||
end
|
||||
|
||||
# Parses the command-line options.
|
||||
# Parse the command-line options
|
||||
#
|
||||
# @param [Array<String>] arguments
|
||||
# Command-line options and arguments to be parsed.
|
||||
|
@ -178,6 +178,8 @@ module Mutant
|
|||
# @raise [Error]
|
||||
# An error occurred while parsing the options.
|
||||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def parse(arguments)
|
||||
|
|
|
@ -129,31 +129,69 @@ module Mutant
|
|||
memoize :subject
|
||||
|
||||
class Finder
|
||||
|
||||
# Run finder
|
||||
#
|
||||
# @param [Parser::AST::Node]
|
||||
#
|
||||
# @return [Parser::AST::Node]
|
||||
# if found
|
||||
#
|
||||
# @return [nil]
|
||||
# otherwise
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
#
|
||||
def self.run(root, &predicate)
|
||||
new(root, predicate).match
|
||||
end
|
||||
|
||||
private_class_method :new
|
||||
|
||||
# Return match
|
||||
#
|
||||
# @return [Parser::AST::Node]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
attr_reader :match
|
||||
|
||||
private
|
||||
|
||||
# Initialize object
|
||||
#
|
||||
# @param [Parer::AST::Node]
|
||||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
#
|
||||
def initialize(root, predicate)
|
||||
@root, @predicate = root, predicate
|
||||
test(root)
|
||||
visit(root)
|
||||
end
|
||||
|
||||
def test(node)
|
||||
# Visit node
|
||||
#
|
||||
# @param [Parser::AST::Node] node
|
||||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def visit(node)
|
||||
if @predicate.call(node)
|
||||
@match = node
|
||||
end
|
||||
|
||||
node.children.each do |child|
|
||||
test(child) if child.kind_of?(Parser::AST::Node)
|
||||
visit(child) if child.kind_of?(Parser::AST::Node)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end # Finder
|
||||
|
||||
# Return matched node
|
||||
#
|
||||
|
|
|
@ -106,6 +106,8 @@ module Mutant
|
|||
#
|
||||
# @param [Array<Parser::AST::Node>] children
|
||||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def emit_self(*children)
|
||||
|
|
|
@ -28,10 +28,22 @@ module Mutant
|
|||
emit_self(s(:str, NULL_REGEXP_SOURCE), options)
|
||||
end
|
||||
|
||||
# Return options
|
||||
#
|
||||
# @return [Parser::AST::Node]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def options
|
||||
children[OPTIONS_INDEX]
|
||||
end
|
||||
|
||||
# Return source
|
||||
#
|
||||
# @return [Parser::AST::Node]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def source
|
||||
children[SOURCE_INDEX]
|
||||
end
|
||||
|
|
|
@ -77,7 +77,7 @@ module Mutant
|
|||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api rpivate
|
||||
# @api private
|
||||
#
|
||||
def emit_implicit_self
|
||||
if receiver.type == :self and !KEYWORDS.include?(selector)
|
||||
|
|
Loading…
Add table
Reference in a new issue