Sha256: e37f7472ff9c2bfc7879f3659694feaf398e6791c87e1bb4272f916764290ae1

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

module Stamp
  module Emitters
    class Ambiguous
      attr_reader :potential_emitters

      def initialize(*emitters)
        @potential_emitters = emitters
      end

      def field
        nil
      end

      def disambiguate(emitters)
        other_emitters = emitters - self
        known_fields = other_emitters.map { |e| e.field }.compact

        potential_emitters.reject do |potential_emitter|
          known_fields.include?(potential_emitter.field)
        end.first
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stamp-0.6.0 lib/stamp/emitters/ambiguous.rb