Class: TinderPyro::Requestor
- Inherits:
-
Object
- Object
- TinderPyro::Requestor
- Includes:
- HTTParty
- Defined in:
- lib/pyro/requestor.rb
Instance Method Summary collapse
- #auth_request(facebook_id, facebook_token) ⇒ Object
- #get_request(endpoint) ⇒ Object
- #post_request(endpoint, data = {}) ⇒ Object
Instance Method Details
#auth_request(facebook_id, facebook_token) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/pyro/requestor.rb', line 7 def auth_request(facebook_id, facebook_token) post_request( :auth, facebook_id: facebook_id, facebook_token: facebook_token ).tap do |response| @auth_token = response['token'] end end |
#get_request(endpoint) ⇒ Object
17 18 19 |
# File 'lib/pyro/requestor.rb', line 17 def get_request(endpoint) self.class.get("/#{endpoint}", headers: all_headers) end |
#post_request(endpoint, data = {}) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/pyro/requestor.rb', line 21 def post_request(endpoint, data = {}) self.class.post( "/#{endpoint}", body: data.to_json, headers: all_headers ) end |