fanforce 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,19 @@
1
1
  class Fanforce
2
2
  class Error < StandardError;
3
+ attr_accessor :path, :query_params, :request, :response, :request_url
4
+
3
5
  def initialize(response, request, path, query_params)
4
6
  @query_params = query_params
5
7
  @path = path
6
8
  @request = request
7
9
  begin
8
- @response = MultiJson.load(response, :symbolize_keys => symbolize_keys)
9
- rescue
10
- @response = response
10
+ @response = MultiJson.load(response, :symbolize_keys => true)
11
+ rescue Exception => e
12
+ @response = "JSON decode error in Gem: #{e.message}"
11
13
  end
12
14
  @request_url = "#{@path}?#{@query_params.to_param}"
13
- super(@response.is_a?(Hash) ? @response[:message] : @response)
15
+ super(@response.is_a?(Hash) ? @response[:msg] : @response)
14
16
  end
15
- attr :path, :query_params, :request, :response, :request_url
16
17
 
17
18
  def curl_command
18
19
  case @request.method
@@ -1,3 +1,3 @@
1
1
  class Fanforce
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: