Class: Mutant::Mutation::Operators Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/mutation/operators.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

Full, Light

Defined Under Namespace

Classes: Full, Light

Constant Summary collapse

TRANSFORM =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Transform::Sequence.new(
  steps: [
    Transform::STRING,
    Transform::Block.capture('parse operator', &method(:parse))
  ]
)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.operators_nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



66
67
68
# File 'lib/mutant/mutation/operators.rb', line 66

def self.operators_name
  self::NAME
end

.parse(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



74
75
76
77
78
79
80
81
82
# File 'lib/mutant/mutation/operators.rb', line 74

def self.parse(value)
  klass = [Light, Full].detect { |candidate| candidate.operators_name.to_s.eql?(value) }

  if klass
    Either::Right.new(klass.new)
  else
    Either::Left.new("Unknown operators: #{value}")
  end
end

Instance Method Details

#selector_replacementsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



70
71
72
# File 'lib/mutant/mutation/operators.rb', line 70

def selector_replacements
  self.class::SELECTOR_REPLACEMENTS
end