@private
# File lib/aws/record/validators/format.rb, line 50 def message options[:message] || 'is invalid' end
# File lib/aws/record/validators/format.rb, line 27 def setup record_class ensure_type(Regexp, :with, :without) ensure_at_least_one(:with, :without) end
# File lib/aws/record/validators/format.rb, line 32 def validate_attribute record, attribute_name, value_or_values each_value(value_or_values) do |value| if options[:with] unless value.to_s =~ options[:with] record.errors.add(attribute_name, message) end end if options[:without] unless value.to_s !~ options[:without] record.errors.add(attribute_name, message) end end end end