Class: ActiveMutator::Operators::Literal

Inherits:
Base
  • Object
show all
Defined in:
lib/active_mutator/operators/literal.rb

Constant Summary

Constants inherited from Base

Base::REGISTRY

Instance Method Summary collapse

Methods inherited from Base

all, inherited

Instance Method Details

#edits(node) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/active_mutator/operators/literal.rb', line 4

def edits(node)
  case node
  when Prism::IntegerNode then integer_edits(node)
  when Prism::StringNode then string_edits(node)
  when Prism::TrueNode
    [edit(loc_range(node.location), "false", "replace `true` with `false`")]
  when Prism::FalseNode
    [edit(loc_range(node.location), "true", "replace `false` with `true`")]
  else []
  end
end