lib/mutant/mutator.rb in mutant-0.3.0.rc5 vs lib/mutant/mutator.rb in mutant-0.3.0
- old
+ new
@@ -11,13 +11,13 @@
#
# @return [self]
#
# @api private
#
- def self.each(node, parent = nil, &block)
- return to_enum(__method__, node, parent) unless block_given?
- Registry.lookup(node).new(node, parent, block)
+ def self.each(input, parent = nil, &block)
+ return to_enum(__method__, input, parent) unless block_given?
+ Registry.lookup(input).new(input, parent, block)
self
end
# Register node class handler
@@ -90,11 +90,11 @@
# @return [false]
#
# @api private
#
def new?(object)
- !@seen.include?(self.class.identity(object))
+ !@seen.include?(identity(object))
end
# Add object to guarded values
#
# @param [Object] object
@@ -102,10 +102,22 @@
# @return [undefined]
#
# @api private
#
def guard(object)
- @seen << self.class.identity(object)
+ @seen << identity(object)
+ end
+
+ # Return identity for input
+ #
+ # @param [Object] input
+ #
+ # @return [Object]
+ #
+ # @api private
+ #
+ def identity(input)
+ self.class.identity(input)
end
# Dispatch node generations
#
# @return [undefined]