Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
valid metaprogramming?
class HTTP
def request(method, options)
# stuff...
end
[
:get,
:head,
:put,
:post
].each do |method|
define_method method do |options|
request method, options
end
end
end
@sgharms
Copy link

sgharms commented Nov 9, 2013

Here are my thoughts. Obviously as a sketch I may be missing something you have in mind, but let me know.

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