Sha256: 5bfd68c1cba27687708bb154ca46afa318d42040359ac79f2ba92864c2b490a9
Contents?: true
Size: 838 Bytes
Versions: 13
Compression:
Stored size: 838 Bytes
Contents
module Shoulda module Matchers module ActiveModel class AllowValueMatcher # @private class AttributeSetters include Enumerable def initialize(allow_value_matcher, values) @tuples = values.map do |attribute_name, value| AttributeSetterAndValidator.new( allow_value_matcher, attribute_name, value ) end end def each(&block) tuples.each(&block) end def first_failing tuples.detect(&method(:does_not_match?)) end protected attr_reader :tuples private def does_not_match?(tuple) !tuple.attribute_setter.set! end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems