Module: Koala::TyphoeusService
- Defined in:
- lib/koala/http_services.rb
Class Method Summary collapse
-
.included(base) ⇒ Object
this service uses Typhoeus to send requests to the graph.
Class Method Details
.included(base) ⇒ Object
this service uses Typhoeus to send requests to the graph
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/koala/http_services.rb', line 58 def self.included(base) base.class_eval do require 'typhoeus' unless defined?(Typhoeus) include Typhoeus def self.make_request(path, args, verb, = {}) # if the verb isn't get or post, send it as a post argument args.merge!({:method => verb}) && verb = "post" if verb != "get" && verb != "post" server = [:rest_api] ? Facebook::REST_SERVER : Facebook::GRAPH_SERVER response = self.send(verb, "https://#{server}/#{path}", :params => args) Koala::Response.new(response.code, response.body, response.headers_hash) end end # class_eval end |