Skip to content

Instantly share code, notes, and snippets.

@mtwilliams
Created October 29, 2015 03:42
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 mtwilliams/110a2fbdc643582690fb to your computer and use it in GitHub Desktop.
Save mtwilliams/110a2fbdc643582690fb to your computer and use it in GitHub Desktop.
class Verse
include Pourable
property :meaning_of_life, :integer, :default => 42,
many :inhabitants, Inhabitant, :id => :name,
:merge => false
end
class Inhabitant
include Pourable
named
property :loves_dark_chocolate, :boolean, :default => true
property :loves_red_wine, :boolean, :default => true
end
universe = Verse.new do |universe|
universe.inhabitant name: 'Michael Williams' do |mike|
mike.loves_dark_chocolate = true
mike.loves_red_wine = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment