Skip to content

Instantly share code, notes, and snippets.

@brianknapp
Created April 12, 2013 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianknapp/5372230 to your computer and use it in GitHub Desktop.
Save brianknapp/5372230 to your computer and use it in GitHub Desktop.
Obvious User Entity
class User < Obvious::Entity
value :email, String
value :password, String
value :id, Fixnum
validation :check_email, Proc.new {
raise StandardError.new 'invalid email address' unless email =~ /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment