lib/i2x/client.rb in i2x-0.0.6 vs lib/i2x/client.rb in i2x-0.0.7
- old
+ new
@@ -1,19 +1,18 @@
require 'rest_client'
-require 'logger'
module I2X
class Client
##
# => Load configuration properties from client/script code
#
def initialize config, log
begin
@config = config
- I2X::Config.set_access_token config[:server][:api_key]
- I2X::Config.set_host config[:server][:host]
- I2X::Config.set_log log
+ I2X::Config.token = config[:server][:api_key]
+ I2X::Config.host = (config[:server][:host].end_with?('/') ? config[:server][:host] : config[:server][:host] << '/')
+ I2X::Config.log = log
I2X::Config.log.info(self.class.name) {'Configuration loaded successfully.'}
rescue Exception => e
I2X::Config.log.error(self.class.name) {"Failed to load configuration: #{e}"}
end
\ No newline at end of file