Sha256: 3995a1a3445618602e7c7cd48a25d36de4e9387b48d2557bf43bb94a1d4bf3e4

Contents?: true

Size: 713 Bytes

Versions: 74

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

module Mutant
  class Mutator
    class Node

      # OpAsgn mutator
      class OpAsgn < self

        handle(:op_asgn)

        children :left, :operation, :right

      private

        def dispatch
          emit_singletons

          left_mutations

          emit_right_mutations
        end

        def left_mutations
          emit_left_mutations do |node|
            !n_self?(node)
          end

          emit_left_promotion if n_send?(left)
        end

        def emit_left_promotion
          receiver = left.children.first

          emit_left(s(:ivasgn, *receiver)) if n_ivar?(receiver)
        end

      end # OpAsgn
    end # Node
  end # Mutator
end # Mutant

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
mutant-0.11.18 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.17 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.16 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.15 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.14 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.13 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.12 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.11 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.10 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.9 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.8 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.7 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.6 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.5 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.4 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.3 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.2 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.1 lib/mutant/mutator/node/op_asgn.rb
mutant-0.11.0 lib/mutant/mutator/node/op_asgn.rb
mutant-0.10.35 lib/mutant/mutator/node/op_asgn.rb