messenger_client 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messenger_client/client.rb +9 -4
- data/lib/messenger_client/config.rb +11 -0
- data/lib/messenger_client/version.rb +1 -1
- data/lib/messenger_client.rb +3 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6088f6bbd3711ae7efdeaf6410498abcdc0d21d0
|
4
|
+
data.tar.gz: 550e200908ed2db624eab4c54ca306ec000ab4eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d417cfb9eba35ead6eb9d7bbdda17763d5d17f4f10a8ca8207b52b06e99f2d77b63bc85766fea41452459d052b5e44a844ae3457d5fd7dfcd67d2c0e2300df1
|
7
|
+
data.tar.gz: 6236d6611b1807b469e081755a26069ad15b6496705f54037daeac78653b09cff19e2a734e25f9c5153b416209bddfeae2215196eb045478adc9e886b3f5b31d
|
@@ -4,6 +4,7 @@ module MessengerClient
|
|
4
4
|
|
5
5
|
def initialize(page_access_token)
|
6
6
|
@page_access_token = page_access_token
|
7
|
+
@logger = MessengerClient::Config.logger
|
7
8
|
end
|
8
9
|
|
9
10
|
def setup_menu(buttons)
|
@@ -81,15 +82,19 @@ module MessengerClient
|
|
81
82
|
payload.merge!(message: data) unless data.nil?
|
82
83
|
payload.merge!(opts)
|
83
84
|
res = Typhoeus.post(url, body: json(payload), headers: headers)
|
84
|
-
|
85
|
-
|
85
|
+
@logger.debug(url) if ENV["DEBUG"]
|
86
|
+
@logger.debug(json(payload)) if ENV["DEBUG"]
|
87
|
+
@logger.debug(res.body) if ENV["DEBUG"]
|
88
|
+
@logger.debug(res.headers) if ENV["DEBUG"]
|
86
89
|
res
|
87
90
|
end
|
88
91
|
|
89
92
|
def post(payload)
|
90
93
|
res = Typhoeus.post(url, body: json(payload), headers: headers)
|
91
|
-
|
92
|
-
|
94
|
+
@logger.debug(url) if ENV["DEBUG"]
|
95
|
+
@logger.debug(json(payload)) if ENV["DEBUG"]
|
96
|
+
@logger.debug(res.body) if ENV["DEBUG"]
|
97
|
+
@logger.debug(res.headers) if ENV["DEBUG"]
|
93
98
|
res
|
94
99
|
end
|
95
100
|
|
data/lib/messenger_client.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: messenger_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Cruz
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/messenger_client/button_template.rb
|
89
89
|
- lib/messenger_client/call_button.rb
|
90
90
|
- lib/messenger_client/client.rb
|
91
|
+
- lib/messenger_client/config.rb
|
91
92
|
- lib/messenger_client/generic_template.rb
|
92
93
|
- lib/messenger_client/get_started.rb
|
93
94
|
- lib/messenger_client/location_template.rb
|