Simplify range mutator
This commit is contained in:
parent
d20655f4c2
commit
67fb6afc55
1 changed files with 7 additions and 27 deletions
|
@ -3,6 +3,7 @@ module Mutant
|
|||
class Literal
|
||||
# Abstract literal range mutator
|
||||
class Range < self
|
||||
include Abstract
|
||||
|
||||
private
|
||||
|
||||
|
@ -48,42 +49,21 @@ module Mutant
|
|||
#
|
||||
# @api private
|
||||
#
|
||||
abstract_method :inverse_class
|
||||
def inverse_class
|
||||
self.class::INVERSE_CLASS
|
||||
end
|
||||
|
||||
# Mutator for range exclude literals
|
||||
class Exclude < self
|
||||
|
||||
INVERSE_CLASS = Rubinius::AST::Range
|
||||
handle(Rubinius::AST::RangeExclude)
|
||||
|
||||
private
|
||||
|
||||
# Return inverse class
|
||||
#
|
||||
# @return [Class:Rubnius::AST::Range]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def inverse_class
|
||||
Rubinius::AST::Range
|
||||
end
|
||||
end
|
||||
|
||||
# Mutator for range literals
|
||||
# Mutator for range include literals
|
||||
class Include < self
|
||||
|
||||
INVERSE_CLASS = Rubinius::AST::RangeExclude
|
||||
handle(Rubinius::AST::Range)
|
||||
|
||||
private
|
||||
|
||||
# Return inverse class
|
||||
#
|
||||
# @return [Class:Rubnius::AST::RangeExclude]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def inverse_class
|
||||
Rubinius::AST::RangeExclude
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue