Sha256: 821e3fc3376de56f5722905510b86bb8a5ffcd41e37df6d39849f6c4c85e17d6

Contents?: true

Size: 820 Bytes

Versions: 4

Compression:

Stored size: 820 Bytes

Contents

module ValidatesFormattingOf
  module ValidationMessages

    class Messages

      def self.hash
        {
          :email => "is not a valid email",
          :url => "is not a valid URL",
          :alpha => "must be only letters or dashes",
          :alphanum => "must be letters, numbers",
          :credit_card => "is not a valid credit card number",
          :us_zip => "is not a valid zipcode",
          :us_phone => "is not a valid phone number",
          :ip_address => "is not a valid IP address",
          :ssn => "is not a valid social security number",
          :hex_color => "is not a valid hex color",
          :dollars => "is not a valid dollar amount"
        }
      end

    end

    extend self

    def message(message)
      Messages.hash[message.to_s.downcase.to_sym]
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
validates_formatting_of-0.5.0 lib/validates_formatting_of/validation_messages.rb
validates_formatting_of-0.4.1 lib/validates_formatting_of/validation_messages.rb
validates_formatting_of-0.4.0 lib/validates_formatting_of/validation_messages.rb
validates_formatting_of-0.3.7 lib/validates_formatting_of/validation_messages.rb