lib/keen/client.rb in keen-0.7.0 vs lib/keen/client.rb in keen-0.7.1
- old
+ new
@@ -4,22 +4,20 @@
require 'keen/client/querying_methods'
require 'openssl'
require 'multi_json'
require 'base64'
-require 'uri'
module Keen
class Client
include Keen::Client::PublishingMethods
include Keen::Client::QueryingMethods
- attr_accessor :project_id, :write_key, :read_key
+ attr_accessor :project_id, :write_key, :read_key, :api_url
CONFIG = {
- :api_host => "api.keen.io",
- :api_port => 443,
+ :api_url => "https://api.keen.io",
:api_version => "3.0",
:api_sync_http_options => {
:use_ssl => true,
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
:verify_depth => 5,
@@ -46,11 +44,13 @@
:write_key => args[1],
:read_key => args[2],
}.merge(args[3] || {})
end
- @project_id, @write_key, @read_key = options.values_at(
+ self.project_id, self.write_key, self.read_key = options.values_at(
:project_id, :write_key, :read_key)
+
+ self.api_url = options[:api_url] || CONFIG[:api_url]
end
private
def process_response(status_code, response_body)