Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahoward/753945 to your computer and use it in GitHub Desktop.
Save ahoward/753945 to your computer and use it in GitHub Desktop.
module_eval(<<-__, __FILE__, __LINE__ - 1)
def #{ mode }(*args, &block)
if args.empty?
mode(#{ mode.inspect }, &block)
else
mode(#{ mode.inspect }) do
call(*args, &block)
end
end
end
def #{ mode }?(&block)
mode?(#{ mode.inspect }, &block)
end
__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment