class Shoulda::Matchers::ActiveModel::AllowValueMatcher::AttributeSetters
@private
Attributes
Public Class Methods
Source
# File lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters.rb, line 9 def initialize(allow_value_matcher, values) @tuples = values.map do |attribute_name, value| AttributeSetterAndValidator.new( allow_value_matcher, attribute_name, value, ) end end
Public Instance Methods
Source
# File lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters.rb, line 19 def each(&block) tuples.each(&block) end
Source
# File lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters.rb, line 23 def first_failing tuples.detect(&method(:does_not_match?)) end
Private Instance Methods
Source
# File lib/shoulda/matchers/active_model/allow_value_matcher/attribute_setters.rb, line 33 def does_not_match?(tuple) !tuple.attribute_setter.set! end