Class: Mutineer::Mutators::Base

Inherits:
Prism::Visitor
  • Object
show all
Defined in:
lib/mutineer/mutators/base.rb

Overview

Base Prism visitor for operators. Subclasses override visit_* methods to push Mutation objects onto @mutations. Visiting only def_node.body is the body-only enforcement — the def signature line is never touched.

ponytail: one implementor in M1; Base earns its keep at M4 when comparison/boolean operators land and share this contract.

Instance Method Summary collapse

Instance Method Details

#mutations_for(subject, source) ⇒ Object



15
16
17
18
19
20
# File 'lib/mutineer/mutators/base.rb', line 15

def mutations_for(subject, source)
  @source = source
  @mutations = []
  subject.def_node.body&.accept(self)
  @mutations
end