Skip to content

Instantly share code, notes, and snippets.

@cloudhead
Created January 16, 2009 19: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 cloudhead/48076 to your computer and use it in GitHub Desktop.
Save cloudhead/48076 to your computer and use it in GitHub Desktop.
#
# 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