Skip to content

Instantly share code, notes, and snippets.

@ezkl
Created February 28, 2012 23:16
Show Gist options
  • Save ezkl/1935971 to your computer and use it in GitHub Desktop.
Save ezkl/1935971 to your computer and use it in GitHub Desktop.
Typhoeus::Request shortcut
require "typhoeus"
module Ty
class << self
include Typhoeus
%w(get post put delete head).each do |method|
define_method(method.to_sym) do |url, opts = {}|
Request.send(method, url, opts)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment