class Shoulda::Matchers::ActiveRecord::ValidateUniquenessOfMatcher::AttributeSetters
@private
Public Class Methods
Source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 1057 def initialize @attribute_setters = [] end
Public Instance Methods
Source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 1071 def +(other_attribute_setters) dup.tap do |attribute_setters| other_attribute_setters.each do |attribute_setter| attribute_setters << attribute_setter end end end
Source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 1061 def <<(given_attribute_setter) index = find_index_of(given_attribute_setter) if index @attribute_setters[index] = given_attribute_setter else @attribute_setters << given_attribute_setter end end
Source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 1079 def each(&block) @attribute_setters.each(&block) end
Source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 1083 def last @attribute_setters.last end
Private Instance Methods
Source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 1089 def find_index_of(given_attribute_setter) @attribute_setters.find_index do |attribute_setter| attribute_setter.attribute_name == given_attribute_setter.attribute_name end end