Skip to content

Instantly share code, notes, and snippets.

@heycarsten
Created October 7, 2010 22:00
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 heycarsten/615985 to your computer and use it in GitHub Desktop.
Save heycarsten/615985 to your computer and use it in GitHub Desktop.
# I had no idea that you could do this:
def attribute(name, type = Ohm::Types::String, klass = Ohm::Types[type])
# If no 3rd argument is provided then it uses the second argument to key
# the default value. Not super obvious, but now that I know about it, I
# think it's kinda cool :-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment