lib/koala.rb in koala-1.0.0.beta vs lib/koala.rb in koala-1.0.0.beta2
- old
+ new
@@ -22,10 +22,13 @@
require 'koala/realtime_updates'
# add test user methods
require 'koala/test_users'
+# add KoalaIO class
+require 'koala/uploadable_io'
+
module Koala
module Facebook
# Ruby client library for the Facebook Platform.
# Copyright 2010 Facebook
@@ -108,11 +111,11 @@
include TestUserMethods
# make the Graph API accessible in case someone wants to make other calls to interact with their users
attr_reader :graph_api
end
- class APIError < Exception
+ class APIError < StandardError
attr_accessor :fb_error_type
def initialize(details = {})
self.fb_error_type = details["type"]
super("#{fb_error_type}: #{details["message"]}")
end
@@ -308,17 +311,21 @@
str += '=' * (4 - str.length.modulo(4))
Base64.decode64(str.gsub('-', '+').gsub('_', '/'))
end
end
end
+
+ class KoalaError< StandardError; end
# finally, set up the http service Koala methods used to make requests
# you can use your own (for HTTParty, etc.) by calling Koala.http_service = YourModule
def self.http_service=(service)
self.send(:include, service)
end
# by default, try requiring Typhoeus -- if that works, use it
+ # if you have Typheous and don't want to use it (or want another service),
+ # you can run Koala.http_service = NetHTTPService (or MyHTTPService)
begin
Koala.http_service = TyphoeusService
rescue LoadError
Koala.http_service = NetHTTPService
end