pyr 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pyr/response.rb +17 -16
- data/lib/pyr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1491c2bf3745ed6129b38b129f867e3e45c411c
|
4
|
+
data.tar.gz: a9117f49800abfef2b3c80c4078e6ca2679db14f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae1fce84b54cdc4d868b087f5c6d1550d08d9498f174214096feca50772da3da9f00c79b8784dbc8257158e810bda35c471b35b1f5cdcc99d5572cfd77263a6b
|
7
|
+
data.tar.gz: bf442cd044a7cdcbe29b75e9a4448043e73d8c78ba43671388768ee26ff0782ae02cd2487d02673ffca81f6c9b39ee1467ee02cd595391c694a83aa2ef6fe91c
|
data/lib/pyr/response.rb
CHANGED
@@ -7,34 +7,35 @@ module PYR
|
|
7
7
|
# # => #<PYR::Response:0x007fe8f90829f8 ... >
|
8
8
|
class Response
|
9
9
|
# Returns a hash of the Raw JSON response
|
10
|
-
#
|
10
|
+
#
|
11
|
+
# response.body # => { ... }
|
11
12
|
attr_reader :body
|
12
13
|
# Returns a string of the URI path
|
13
|
-
#
|
14
|
-
#
|
14
|
+
#
|
15
|
+
# response.path # => 'reps/S000033'
|
15
16
|
attr_reader :path
|
16
17
|
# Returns an integer of the HTTP status code
|
17
|
-
#
|
18
|
-
#
|
18
|
+
#
|
19
|
+
# response.code # => 200
|
19
20
|
attr_reader :code
|
20
21
|
# Returns a string of the response HTTP reason phrase
|
21
|
-
#
|
22
|
-
#
|
22
|
+
#
|
23
|
+
# response.reason_phrase # => "OK"
|
23
24
|
attr_reader :reason_phrase
|
24
25
|
# Returns a hash of the response HTTP headers
|
25
|
-
#
|
26
|
-
#
|
26
|
+
#
|
27
|
+
# response.headers # => {"server"=>"Cowboy", "connection"=>"close", ... }
|
27
28
|
attr_reader :headers
|
28
29
|
# Returns a collection of PYR::ResponseObjects representing API objects
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
30
|
+
#
|
31
|
+
# response.objects
|
32
|
+
# # => #<PYR::RepRelation [#<PYR::Rep ... >]>
|
33
|
+
# response.objects.first.office_locations
|
34
|
+
# # => #<PYR::OfficeLocationRelation [#<PYR::OfficeLocation ... >]>
|
34
35
|
attr_reader :objects
|
35
36
|
# Returns a symbol representing the Responding API controller
|
36
|
-
#
|
37
|
-
#
|
37
|
+
#
|
38
|
+
# response.controller # => :reps
|
38
39
|
attr_reader :controller
|
39
40
|
|
40
41
|
def initialize(uri: nil, resource: nil, response_object: nil)
|
data/lib/pyr/version.rb
CHANGED