Skip to content

Instantly share code, notes, and snippets.

@stephenprater
Created July 1, 2011 17:22
Show Gist options
  • Save stephenprater/1059000 to your computer and use it in GitHub Desktop.
Save stephenprater/1059000 to your computer and use it in GitHub Desktop.
module BlackMagick
def keys &block
define_method :keys, &block
end
end
class LeThing
extend BlackMagick
end
klass = Class.new(LeThing) do |c|
keys do
['name','date','magic']
end
end
#klass.keys => ['name','date','magic']
#Instead I get 'ArgumentError, tried to create Proc object without a block'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment