Sha256: 74057daa05484c9e98eb18c4f65802377f8cea2412111554cebc50e8f1c005eb

Contents?: true

Size: 267 Bytes

Versions: 5

Compression:

Stored size: 267 Bytes

Contents

class Hobo::EmailAddress < String
  
  COLUMN_TYPE = :string
  
  def validate
    "is not a valid email address" unless 
      self.blank? || self =~ /^\s*([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\s*$/i
  end

end

Hobo.field_types[:email_address] = Hobo::EmailAddress

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hobo-0.6.4 hobo_files/plugin/lib/hobo/email_address.rb
hobo-0.6.3 hobo_files/plugin/lib/hobo/email_address.rb
hobo-0.7.0 hobo_files/plugin/lib/hobo/email_address.rb
hobo-0.7.1 hobo_files/plugin/lib/hobo/email_address.rb
hobo-0.7.2 hobo_files/plugin/lib/hobo/email_address.rb