Fix all yard docs

This commit is contained in:
Markus Schirp 2013-06-15 16:37:43 +02:00
parent 7ae6e09908
commit c6d1c3c0c8
5 changed files with 60 additions and 6 deletions

View file

@ -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)

View file

@ -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
#

View file

@ -106,6 +106,8 @@ module Mutant
#
# @param [Array<Parser::AST::Node>] children
#
# @return [undefined]
#
# @api private
#
def emit_self(*children)

View file

@ -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

View file

@ -77,7 +77,7 @@ module Mutant
#
# @return [undefined]
#
# @api rpivate
# @api private
#
def emit_implicit_self
if receiver.type == :self and !KEYWORDS.include?(selector)