class Shoulda::Matchers::ActiveRecord::ValidateUniquenessOfMatcher::AttributeSetters
@private
Public Class Methods
new()
click to toggle source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 932 def initialize @attribute_setters = [] end
Public Instance Methods
+(other_attribute_setters)
click to toggle source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 946 def +(other_attribute_setters) dup.tap do |attribute_setters| other_attribute_setters.each do |attribute_setter| attribute_setters << attribute_setter end end end
<<(given_attribute_setter)
click to toggle source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 936 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
each(&block)
click to toggle source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 954 def each(&block) @attribute_setters.each(&block) end
last()
click to toggle source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 958 def last @attribute_setters.last end
Private Instance Methods
find_index_of(given_attribute_setter)
click to toggle source
# File lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb, line 964 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