Class: Bottle::Client
- Inherits:
-
Object
- Object
- Bottle::Client
- Defined in:
- lib/client/rest_calls.rb,
lib/bottle_ruby.rb
Overview
API_URL = “mercyapp-staging.herokuapp.com/api/v1/”
Instance Method Summary collapse
-
#initialize(uid, token) ⇒ Client
constructor
A new instance of Client.
- #post(url_extension, params) ⇒ Object
- #request ⇒ Object
- #token ⇒ Object
- #uid ⇒ Object
Constructor Details
#initialize(uid, token) ⇒ Client
12 13 14 15 |
# File 'lib/bottle_ruby.rb', line 12 def initialize(uid, token) @uid = uid @token = token end |
Instance Method Details
#post(url_extension, params) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/client/rest_calls.rb', line 9 def post(url_extension, params) connection = Faraday.new(url: API_URL) response = connection.post(url_extension, params.merge({uid: self.uid, token: self.token})) = JSON.parse(response.body) return Bottle::Message.new() end |
#request ⇒ Object
6 7 |
# File 'lib/client/rest_calls.rb', line 6 def request() end |
#token ⇒ Object
21 22 23 |
# File 'lib/bottle_ruby.rb', line 21 def token @token end |
#uid ⇒ Object
17 18 19 |
# File 'lib/bottle_ruby.rb', line 17 def uid @uid end |