Sha256: 5cca39849ef9506d256a631222cd0bf119d79f25e4a73cb3f47eec0590067363

Contents?: true

Size: 888 Bytes

Versions: 7

Compression:

Stored size: 888 Bytes

Contents

# encoding: UTF-8

module Mutant
  class Mutator
    class Node
      # Mutator for resbody nodes
      class Resbody < self

        handle(:resbody)

        children :captures, :assignment, :body

      private

        # Emit mutations
        #
        # @return [undefined]
        #
        # @api private
        #
        def dispatch
          emit_assignment(nil)
          emit_body_mutations if body
          mutate_captures
        end

        # Mutate captures
        #
        # @return [undefined]
        #
        # @api private
        #
        def mutate_captures
          return unless captures
          Util::Array::Element.each(captures.children, self) do |matchers|
            next if matchers.any?(&method(:n_nil?))
            emit_captures(s(:array, *matchers))
          end
        end

      end # Resbody
    end # Node
  end # Mutator
end # Mutant

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mutant-0.5.26 lib/mutant/mutator/node/resbody.rb
mutant-0.5.25 lib/mutant/mutator/node/resbody.rb
mutant-0.5.24 lib/mutant/mutator/node/resbody.rb
mutant-0.5.23 lib/mutant/mutator/node/resbody.rb
mutant-0.5.22 lib/mutant/mutator/node/resbody.rb
mutant-0.5.21 lib/mutant/mutator/node/resbody.rb
mutant-0.5.20 lib/mutant/mutator/node/resbody.rb