Skip to content

Instantly share code, notes, and snippets.

@zr2d2
Created April 30, 2012 04:00
Show Gist options
  • Select an option

  • Save zr2d2/2555376 to your computer and use it in GitHub Desktop.

Select an option

Save zr2d2/2555376 to your computer and use it in GitHub Desktop.
# Get level name of a membership
def level_name
Membership::LEVELS.key(level)
end
@zr2d2
Copy link
Author

zr2d2 commented Apr 30, 2012

def level_name
(hash.respond_to?(:key) ? hash.key(level) : hash.index(level))
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment