Sha256: 9580831564352653bab87638e372dda39652ee5d76aeac644cfe17138b2c07eb

Contents?: true

Size: 690 Bytes

Versions: 27

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module Mutant
  # Generator for mutations
  class Mutator
    include(
      Adamantium,
      AbstractType,
      Anima.new(:input, :parent),
      Procto
    )

    # Return output
    #
    # @return [Set<Parser::AST::Node>]
    attr_reader :output

    alias_method :call, :output

  private

    def initialize(_attributes)
      super

      @output = Set.new

      dispatch
    end

    def new?(object)
      !object.eql?(input)
    end

    abstract_method :dispatch
    private :dispatch

    def emit(object)
      return unless new?(object)

      output << object
    end

    def dup_input
      input.dup
    end

  end # Mutator
end # Mutant

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mutant-0.12.4 lib/mutant/mutator.rb
mutant-0.12.3 lib/mutant/mutator.rb
mutant-0.12.2 lib/mutant/mutator.rb
mutant-0.12.0 lib/mutant/mutator.rb
mutant-0.11.34 lib/mutant/mutator.rb
mutant-0.11.33 lib/mutant/mutator.rb
mutant-0.11.32 lib/mutant/mutator.rb
mutant-0.11.31 lib/mutant/mutator.rb
mutant-0.11.30 lib/mutant/mutator.rb
mutant-0.11.29 lib/mutant/mutator.rb
mutant-0.11.28 lib/mutant/mutator.rb
mutant-0.11.27 lib/mutant/mutator.rb
mutant-0.11.26 lib/mutant/mutator.rb
mutant-0.11.25 lib/mutant/mutator.rb
mutant-0.11.24 lib/mutant/mutator.rb
mutant-0.11.23 lib/mutant/mutator.rb
mutant-0.11.22 lib/mutant/mutator.rb
mutant-0.11.21 lib/mutant/mutator.rb
mutant-0.11.20 lib/mutant/mutator.rb
mutant-0.11.19 lib/mutant/mutator.rb