Sha256: e3443b2d8fb1216ae77198de3bafe8e5035dddf1a2a5b5f146ce4b9e22106196

Contents?: true

Size: 1.06 KB

Versions: 13

Compression:

Stored size: 1.06 KB

Contents

module Mutant
  # Abstract matcher to find subjects to mutate
  class Matcher
    include Adamantium::Flat, Enumerable, AbstractType
    extend DescendantsTracker

    # Enumerate subjects
    #
    # @param [Object] input
    #
    # @return [self]
    #   if block given
    #
    # @return [Enumerable<Subject>]
    #
    # @api private
    #
    def self.each(cache, input, &block)
      return to_enum(__method__, cache, input) unless block_given?

      build(cache, input).each(&block)

      self
    end

    # Default matcher build implementation
    #
    # @param [Cache] cache
    # @param [Object] input
    #
    # @return [undefined]
    #
    # @api private
    #
    def self.build(*arguments)
      new(*arguments)
    end

    # Enumerate subjects
    #
    # @api private
    #
    # @return [self]
    #   if block given
    #
    # @return [Enumerabe<Subject>]
    #   otherwise
    #
    abstract_method :each

    # Return identification
    #
    # @return [String
    #
    # @api private
    #
    abstract_method :identification

  end # Matcher
end # Mutant

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 lib/mutant/matcher.rb
mutant-0.3.0.beta20 lib/mutant/matcher.rb
mutant-0.3.0.beta19 lib/mutant/matcher.rb
mutant-0.3.0.beta18 lib/mutant/matcher.rb
mutant-0.3.0.beta17 lib/mutant/matcher.rb
mutant-0.3.0.beta16 lib/mutant/matcher.rb
mutant-0.3.0.beta15 lib/mutant/matcher.rb
mutant-0.3.0.beta14 lib/mutant/matcher.rb
mutant-0.3.0.beta13 lib/mutant/matcher.rb
mutant-0.3.0.beta12 lib/mutant/matcher.rb
mutant-0.3.0.beta11 lib/mutant/matcher.rb
mutant-0.3.0.beta10 lib/mutant/matcher.rb
mutant-0.3.0.beta9 lib/mutant/matcher.rb