Class: JawboneUp::Client
- Inherits:
-
Object
show all
- Defined in:
- lib/jawbone_up/client.rb,
lib/jawbone_up/client/version.rb,
lib/jawbone_up/client/response.rb,
lib/jawbone_up/client/configuration.rb,
lib/jawbone_up/client/response/item.rb,
lib/jawbone_up/client/response/meta.rb
Defined Under Namespace
Classes: Configuration, Response
Constant Summary
collapse
- BASE_URL =
"https://jawbone.com"
- API_VERSION =
"v.1.1"
- API_URL =
"#{BASE_URL}/nudge/api/#{API_VERSION}"
- VERSION =
"0.1.0"
Class Method Summary
collapse
Instance Method Summary
collapse
-
#delete(path, params: {}, headers: {}) ⇒ Object
-
#get(path, params: {}, headers: {}) ⇒ Object
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
-
#post(path, payload: nil, params: {}, headers: {}) ⇒ Object
-
#put(path, payload: nil, params: {}, headers: {}) ⇒ Object
Constructor Details
#initialize(token) ⇒ Client
Returns a new instance of Client.
23
24
25
|
# File 'lib/jawbone_up/client.rb', line 23
def initialize(token)
@token = token
end
|
Class Method Details
.config ⇒ Object
19
20
21
|
# File 'lib/jawbone_up/client.rb', line 19
def self.config
@config ||= Configuration.new
end
|
15
16
17
|
# File 'lib/jawbone_up/client.rb', line 15
def self.configure(&block)
yield config
end
|
Instance Method Details
#delete(path, params: {}, headers: {}) ⇒ Object
39
40
41
|
# File 'lib/jawbone_up/client.rb', line 39
def delete(path, params: {}, headers: {})
request(:delete, path, params: params, headers: )
end
|
#get(path, params: {}, headers: {}) ⇒ Object
27
28
29
|
# File 'lib/jawbone_up/client.rb', line 27
def get(path, params: {}, headers: {})
request(:get, path, params: params, headers: )
end
|
#post(path, payload: nil, params: {}, headers: {}) ⇒ Object
31
32
33
|
# File 'lib/jawbone_up/client.rb', line 31
def post(path, payload: nil, params: {}, headers: {})
request(:post, path, payload: payload, params: params, headers: )
end
|
#put(path, payload: nil, params: {}, headers: {}) ⇒ Object
35
36
37
|
# File 'lib/jawbone_up/client.rb', line 35
def put(path, payload: nil, params: {}, headers: {})
request(:put, path, payload: payload, params: params, headers: )
end
|