Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Created January 7, 2012 20:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/1575920 to your computer and use it in GitHub Desktop.
Save krainboltgreene/1575920 to your computer and use it in GitHub Desktop.
class Person
include Intrinsic
property :name, String
property :email, String
property :age, Integer, default: 13
embeds :skills do
property :name
property :rank, Integer, default: 0
end
validation_for :name { |name| !name.blank? && name.match =~ /\w+|\,+|\.+|\-+|\s+/ }
validation_for :email { |email| !email.blank? }
validation_for :age { |age| (13..90).include? age }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment