Class: Bottle::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/client/rest_calls.rb,
lib/bottle_ruby.rb

Overview

Instance Method Summary collapse

Constructor Details

#initialize(uid, token) ⇒ Client

Returns a new instance of 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}))
  message_attributes = JSON.parse(response.body)
  return Bottle::Message.new(message_attributes)
end

#requestObject



6
7
# File 'lib/client/rest_calls.rb', line 6

def request()
end

#tokenObject



21
22
23
# File 'lib/bottle_ruby.rb', line 21

def token
  @token
end

#uidObject



17
18
19
# File 'lib/bottle_ruby.rb', line 17

def uid
  @uid
end