Created
January 16, 2009 19:42
-
-
Save cloudhead/48076 to your computer and use it in GitHub Desktop.
This file contains 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
# | |
# Cloud has many thoughts | |
# | |
@cld = Cloud.new('Earl') | |
## Get thought with title 'hello', belonging to cloud titled 'Earl' | |
t = @cld.thought 'hello' | |
# or | |
t = @cld.thought :title => 'hello' | |
# or | |
t = @cld.child( :thought, :title => 'hello' ) | |
# or | |
t = @cld.child( Thought.new 'hello' ) | |
## Set title | |
t.title = 'goodbye' | |
# or | |
@cld.thought('hello').title = 'goodbye' | |
t.save | |
# or | |
Cloud.new('Earl').child( Thought.new 'hello' ).title=('goodbye').save | |
@cld.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment