fanforce-api 0.14.2 → 0.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +2 -2
- data/lib/fanforce/api/response.rb +9 -0
- data/lib/fanforce/api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmM0MjMwNzdlNjNiMTkzZDNiZDQwNTI0MDE3ZTk3NDhjOTg2MTA2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmQwMzU0NDk3MDYzOTcxYzM2MWM0M2FmYTFkMjljZDYyMzk1MTkxZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2M4NWJhYWYxMzMwMjMwOWJkNTU0ZGQ1ZDZiY2U3NTJmMDY0NzI2ZjQyN2Qy
|
10
|
+
N2ExZGVjYzI5NjAwOTlhM2NmZTM1ZjVjNWRkNzllZWIwOTA5OGNhZjQ4YjAz
|
11
|
+
YmJmYjJmMWFhMjc1MmM1MDIwYWRiY2Y1ODkzMWZhOWYwYTg1MmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWZkNzUyNDMwZjE5ZjM3Njc4MmQ2MjliZGZmYmM2ZDAzMmI3NzdmZDJkNTQx
|
14
|
+
NGZkMmIzM2MzNDZlMTc5MDc2OWY3MDBkNDhhOGMxYzU4NWZhMjJiZDhlM2Jm
|
15
|
+
MTk3OGIwZDk2ODUwYjBhMDEyZDFhMmQwOWFkYjUwMjU3YTEzYTA=
|
data/README.md
CHANGED
@@ -22,13 +22,13 @@ $ gem install pkg/fanforce-{version}
|
|
22
22
|
|
23
23
|
``` ruby
|
24
24
|
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
|
25
|
-
require 'fanforce'
|
25
|
+
require 'fanforce/api'
|
26
26
|
|
27
27
|
# put your own credentials here
|
28
28
|
api_key = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
29
29
|
|
30
30
|
# set up a client to talk to the Fanforce API
|
31
|
-
ff = Fanforce.new api_key
|
31
|
+
ff = Fanforce::API.new api_key
|
32
32
|
```
|
33
33
|
|
34
34
|
### Making Your First Call
|
@@ -2,6 +2,15 @@ class Fanforce::API::Response
|
|
2
2
|
attr_reader :curl_command, :requested_url, :requested_params
|
3
3
|
|
4
4
|
def self.process(response, request, requested_url, requested_params)
|
5
|
+
if response.code > 201
|
6
|
+
puts "FANFORCE API CRAPPED OUT: #{response.code}"
|
7
|
+
puts response.args.to_json
|
8
|
+
puts '--------------------------------------'
|
9
|
+
puts response.body
|
10
|
+
puts '--------------------------------------'
|
11
|
+
puts response.net_http_res
|
12
|
+
end
|
13
|
+
|
5
14
|
raise Fanforce::API::ServerError.new(response, request, requested_url, requested_params) if response.code > 201
|
6
15
|
begin response_hash = Fanforce::Utils.decode_json(response)
|
7
16
|
rescue Exception => e; raise Fanforce::API::DecodingError.new(e, response, request, requested_url, requested_params) end
|
data/lib/fanforce/api/version.rb
CHANGED