lib/bobot/graph_facebook.rb in bobot-1.0.53 vs lib/bobot/graph_facebook.rb in bobot-2.1.0

- old
+ new

@@ -1,9 +1,9 @@ module Bobot module GraphFacebook GRAPH_FB_URL = 'https://graph.facebook.com'.freeze - GRAPH_FB_VERSION = 'v2.10'.freeze + GRAPH_FB_VERSION = 'v2.11'.freeze module ClassMethods def graph_get(path, query: {}) uri = URI.parse(File.join(GRAPH_FB_URL, GRAPH_FB_VERSION, path)) uri.query = URI.encode_www_form(query) @@ -17,11 +17,11 @@ http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 300 end res = https.request(req) json = ActiveSupport::JSON.decode(res.send(:body) || '{}') - if Bobot.debug_log + if Bobot.config.debug_log puts "[GET] >> #{uri.request_uri}" puts "[GET] << #{json}" end Bobot::ErrorParser.raise_errors_from(json) json @@ -42,11 +42,11 @@ http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 300 end res = https.request(req) json = ActiveSupport::JSON.decode(res.send(:body) || '{}') - if Bobot.debug_log + if Bobot.config.debug_log puts "[POST] >> #{uri.request_uri}" puts "[POST] << #{json}" end Bobot::ErrorParser.raise_errors_from(json) json @@ -67,10 +67,10 @@ http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 300 end res = https.request(req) json = ActiveSupport::JSON.decode(res.send(:body) || '{}') - if Bobot.debug_log + if Bobot.config.debug_log puts "[DELETE] >> #{uri.request_uri}" puts "[DELETE] << #{json}" end Bobot::ErrorParser.raise_errors_from(json) json