class AWS::Record::FormatValidator
@private
def message
def message options[:message] || 'is invalid' end
def setup record_class
def setup record_class ensure_type(Regexp, :with, :without) ensure_at_least_one(:with, :without) end
def validate_attribute record, attribute_name, value_or_values
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