Skip to content

Instantly share code, notes, and snippets.

@kapowaz

kapowaz/apple.rb Secret

Created June 10, 2013 14:43
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 kapowaz/ed0e736b246c140b0d2b to your computer and use it in GitHub Desktop.
Save kapowaz/ed0e736b246c140b0d2b to your computer and use it in GitHub Desktop.
class Apple
include Fruit
property :colour, Enum[:red, :green]
end
module Fruit
def self.included(base)
include DataMapper::Resource
property :id, Serial
property :juiciness, Integer
property :price, Integer
property :name, String
end
end
class Orange
include Fruit
property :type, Enum[:navel, :valencia, :blood]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment