Skip to content

Instantly share code, notes, and snippets.

@fousa
Created July 18, 2012 09:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fousa/3135218 to your computer and use it in GitHub Desktop.
Save fousa/3135218 to your computer and use it in GitHub Desktop.
Dynamic Role Methods
self.roles.each do |r|
define_method "#{r}?" do
role == r
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment