Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 27 lines (25 sloc) 0.561 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
module Typhoeus
  module Requests
    module Operations
      def self.included(base)
        base.extend ClassMethods
      end

      module ClassMethods
        def run(url, params = {})
          r = new(url, params)
          r.run
        end
      end

      def run
        easy = Typhoeus.get_easy
        easy.http_request(url, options[:method] || :get, options)
        easy.prepare
        easy.perform
        @response = Response.new(easy.to_hash)
        Typhoeus.release_easy(easy)
        complete
        @response
      end
    end
  end
end
Something went wrong with that request. Please try again.