/apple.rb Secret
Created
June 10, 2013 14:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Apple | |
include Fruit | |
property :colour, Enum[:red, :green] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fruit | |
def self.included(base) | |
include DataMapper::Resource | |
property :id, Serial | |
property :juiciness, Integer | |
property :price, Integer | |
property :name, String | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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