module Gemwork1

Constants

VERSION

Public Instance Methods

validates_email_address_of(attr_name) click to toggle source
# File lib/gemwork1.rb, line 4
def validates_email_address_of attr_name
  email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
  self.validates_format_of attr_name,
                           :with => email_regex,
                           :message => "is not a valid email address"
end