module Mutant class Matcher # A chain of matchers class Chain < self include Equalizer.new(:matchers) # Enumerate subjects # # @return [Enumerator] # # @api private # attr_reader :matchers # Build matcher chain # # @param [Enumerable] matchers # # @return [Matcher] # # @api private # def self.build(matchers) if matchers.length == 1 return matchers.first end new(matchers) end private # Initialize chain matcher # # @param [Enumerable] matchers # # @return [undefined] # # @api private # def initialize(matchers) @matchers = matchers end end end end