fb_page_api 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fb_page_api/edge/base.rb +12 -4
- data/lib/fb_page_api/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: 6a394ee438f8ff148dc5dc0660b3eaa200883af0
|
4
|
+
data.tar.gz: 1501899c12a975ff3b89d4b3b2ef8670c42fec12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cbd2a75a51e7708516774cbec553e595d5a642984f3780767da46c0adc33dddeff10776c7d334ebe93bb685f4afc9af52299d32d7f310e603def732b66c4874
|
7
|
+
data.tar.gz: 86f30898ab8e33505448528e2a2229cc275d10bf69cd14804e860e88cf8076710c6bbbd77f12e42d8a62b2d371841eb628f2b5b3b9bf249dc5461f06ccf1ce86
|
@@ -11,7 +11,7 @@ module FbPageApi
|
|
11
11
|
options = args.extract_options!
|
12
12
|
@collection = []
|
13
13
|
begin
|
14
|
-
rs =
|
14
|
+
rs = http_request(:get, api_endpoint, query: body_params(options))
|
15
15
|
data = rs.parsed_response['data']
|
16
16
|
if data.present?
|
17
17
|
@collection = @collection | data
|
@@ -22,16 +22,16 @@ module FbPageApi
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def get(object_id)
|
25
|
-
|
25
|
+
http_request(:get, object_api_endpoint(object_id), query: body_params).parsed_response
|
26
26
|
end
|
27
27
|
|
28
28
|
def delete(object_id)
|
29
|
-
|
29
|
+
http_request(:delete, object_api_endpoint(object_id), query: body_params).parsed_response
|
30
30
|
end
|
31
31
|
|
32
32
|
def create(*args)
|
33
33
|
options = args.extract_options!
|
34
|
-
|
34
|
+
http_request(:post, api_endpoint, query: body_params(options)).parsed_response
|
35
35
|
end
|
36
36
|
|
37
37
|
private
|
@@ -39,6 +39,14 @@ module FbPageApi
|
|
39
39
|
raise 'Please override this method in inherit class'
|
40
40
|
end
|
41
41
|
|
42
|
+
def http_request(method, *args)
|
43
|
+
rs = HTTParty.send(method, *args)
|
44
|
+
if rs.code != 200
|
45
|
+
raise rs.parsed_response['error']['message']
|
46
|
+
end
|
47
|
+
rs
|
48
|
+
end
|
49
|
+
|
42
50
|
def api_endpoint
|
43
51
|
"#{Config.api_endpoint}/#{self.parent_id}/#{edge_name}"
|
44
52
|
end
|
data/lib/fb_page_api/version.rb
CHANGED