Skip to content

Instantly share code, notes, and snippets.

@ljsc
Created August 6, 2011 14:15
Show Gist options
  • Save ljsc/1129363 to your computer and use it in GitHub Desktop.
Save ljsc/1129363 to your computer and use it in GitHub Desktop.
Dancing around nils
get_membership(:user => user) do |m|
m.one {|m| do_something_with_one_membership(m) }
m.none { oops_no_membership() }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment