class Borneo::Client

Attributes

application_name[R]
application_version[R]
client_id[R]
client_secret[R]
redirect_url[R]

Public Class Methods

disable_mocking!() click to toggle source
# File lib/borneo/client.rb, line 14
def self.disable_mocking!
  @@should_mock_requests = false
end
enable_mocking!() click to toggle source
# File lib/borneo/client.rb, line 9
def self.enable_mocking!
  @@should_mock_requests = true
  @@service_stubs = {}
end
new(client_id, client_secret, redirect_url, application_name = "Borneo Application", application_version = "0.0.1") click to toggle source
# File lib/borneo/client.rb, line 26
def initialize(client_id, client_secret, redirect_url, application_name = "Borneo Application", application_version = "0.0.1")
  @client_id = client_id
  @client_secret = client_secret
  @redirect_url = redirect_url
  @google_client = nil
  @application_name = application_name
  @application_version = application_version
end
reset_mocks!() click to toggle source
# File lib/borneo/client.rb, line 18
def self.reset_mocks!
  @@service_stubs = {}
end
stub_service(service_name, service_version) click to toggle source
# File lib/borneo/client.rb, line 22
def self.stub_service(service_name, service_version)
  @@service_stubs[[service_name, service_version]] ||= Borneo::Mock::Service.new(self, service_name, service_version)
end

Public Instance Methods

for(access_token, refresh_token) click to toggle source
# File lib/borneo/client.rb, line 35
def for(access_token, refresh_token)
  google_client.authorization.clear_credentials!
  Borneo::AuthorizedProxy.new(self,access_token, refresh_token)
end
google_client() click to toggle source
# File lib/borneo/client.rb, line 40
def google_client
  @google_client ||= Google::APIClient.new(:application_name => @application_name, :application_version => @application_version)
end
mocking_requests?() click to toggle source
# File lib/borneo/client.rb, line 44
def mocking_requests?
  !!@@should_mock_requests
end