lib/mutant/expression.rb in mutant-0.8.8 vs lib/mutant/expression.rb in mutant-0.8.9
- old
+ new
@@ -11,21 +11,17 @@
private_constant(*constants(false))
# Syntax of expression
#
# @return [String]
- #
- # @api private
abstract_method :syntax
# Match length with other expression
#
# @param [Expression] other
#
# @return [Fixnum]
- #
- # @api private
def match_length(other)
if eql?(other)
syntax.length
else
0
@@ -35,12 +31,10 @@
# Test if expression is prefix
#
# @param [Expression] other
#
# @return [Boolean]
- #
- # @api private
def prefix?(other)
!match_length(other).zero?
end
# Try to parse input into expression of receiver class
@@ -50,11 +44,9 @@
# @return [Expression]
# when successful
#
# @return [nil]
# otherwise
- #
- # @api private
def self.try_parse(input)
match = self::REGEXP.match(input)
return unless match
names = anima.attribute_names
new(Hash[names.zip(names.map(&match.method(:[])))])