arcus 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/arcus/api.rb +6 -6
- data/lib/arcus/version.rb +1 -1
- metadata +1 -1
data/lib/arcus/api.rb
CHANGED
@@ -54,9 +54,9 @@ module Arcus
|
|
54
54
|
def initialize(command_name, params, callbacks)
|
55
55
|
@command_name = command_name
|
56
56
|
@params = params
|
57
|
-
@api_uri = Api.settings.api_uri
|
58
|
-
@api_key = Api.settings.api_key
|
59
|
-
@api_secret = Api.settings.api_secret
|
57
|
+
@api_uri = Arcus::Api.settings.api_uri
|
58
|
+
@api_key = Arcus::Api.settings.api_key
|
59
|
+
@api_secret = Arcus::Api.settings.api_secret
|
60
60
|
@callbacks = callbacks
|
61
61
|
end
|
62
62
|
|
@@ -104,7 +104,7 @@ module Arcus
|
|
104
104
|
end
|
105
105
|
params = @params.merge({:command => @command_name})
|
106
106
|
req_url = @api_uri.path + "?" + generate_params_str(params, @api_key, @api_secret)
|
107
|
-
Arcus.log.debug { "Sending: #{req_url}" } if Api.settings.verbose
|
107
|
+
Arcus.log.debug { "Sending: #{req_url}" } if Arcus::Api.settings.verbose
|
108
108
|
response = begin
|
109
109
|
http.get(req_url)
|
110
110
|
rescue Timeout::Error => e
|
@@ -116,7 +116,7 @@ module Arcus
|
|
116
116
|
e.api_uri = @api_uri
|
117
117
|
raise e
|
118
118
|
end
|
119
|
-
Arcus.log.debug { "Received: #{response.body}" } if Api.settings.verbose
|
119
|
+
Arcus.log.debug { "Received: #{response.body}" } if Arcus::Api.settings.verbose
|
120
120
|
response.instance_eval do
|
121
121
|
class << self
|
122
122
|
attr_accessor :response_type
|
@@ -285,7 +285,7 @@ module Arcus
|
|
285
285
|
end
|
286
286
|
|
287
287
|
def prepare(params = {}, callbacks = {})
|
288
|
-
params[:response] ||= Api.settings.default_response
|
288
|
+
params[:response] ||= Arcus::Api.settings.default_response
|
289
289
|
Request.new(self.name, params, callbacks)
|
290
290
|
end
|
291
291
|
end
|
data/lib/arcus/version.rb
CHANGED