Class: TutumApi
- Inherits:
-
Object
show all
- Defined in:
- lib/tutum_api.rb
Constant Summary
collapse
- BASE_API_PATH =
'https://dashboard.tutum.co/api'
- API_VERSION =
'v1'
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(headers) ⇒ TutumApi
9
10
11
|
# File 'lib/tutum_api.rb', line 9
def initialize()
=
end
|
Instance Attribute Details
Returns the value of attribute headers.
4
5
6
|
# File 'lib/tutum_api.rb', line 4
def
end
|
Instance Method Details
#http_delete(path) ⇒ Object
29
30
31
|
# File 'lib/tutum_api.rb', line 29
def http_delete(path)
RestClient.delete(url(path), )
end
|
#http_get(path) ⇒ Object
17
18
19
|
# File 'lib/tutum_api.rb', line 17
def http_get(path)
RestClient.get(url(path), )
end
|
#http_post(path, content = {}) ⇒ Object
21
22
23
|
# File 'lib/tutum_api.rb', line 21
def http_post(path, content={})
RestClient.post(url(path), content.to_json, )
end
|
#http_put(path, content = {}) ⇒ Object
25
26
27
|
# File 'lib/tutum_api.rb', line 25
def http_put(path, content={})
RestClient.put(url(path), content.to_json, )
end
|
#url(path) ⇒ Object
13
14
15
|
# File 'lib/tutum_api.rb', line 13
def url(path)
BASE_API_PATH + '/' + API_VERSION + path
end
|