Class: DataCatalog::Document
- Inherits:
-
Base
- Object
- Mash
- Base
- DataCatalog::Document
show all
- Defined in:
- lib/resources/document.rb
Class Method Summary
collapse
Methods inherited from Base
_first, check_status, cursor, error, filterize, filterize_hash, http_delete, http_get, http_post, http_put, one, query_hash
Class Method Details
.all(conditions = {}) ⇒ Object
5
6
7
|
# File 'lib/resources/document.rb', line 5
def self.all(conditions={})
cursor(uri, query_hash(conditions))
end
|
.create(params = {}) ⇒ Object
9
10
11
|
# File 'lib/resources/document.rb', line 9
def self.create(params={})
one(http_post(uri, :body => params))
end
|
.destroy(id) ⇒ Object
13
14
15
|
# File 'lib/resources/document.rb', line 13
def self.destroy(id)
one(http_delete(uri(id)))
end
|
.first(conditions = {}) ⇒ Object
17
18
19
|
# File 'lib/resources/document.rb', line 17
def self.first(conditions={})
_first(http_get(uri, :query => query_hash(conditions)))
end
|
.get(id) ⇒ Object
21
22
23
|
# File 'lib/resources/document.rb', line 21
def self.get(id)
one(http_get(uri(id)))
end
|
.update(id, params = {}) ⇒ Object
25
26
27
|
# File 'lib/resources/document.rb', line 25
def self.update(id, params={})
one(http_put(uri(id), :body => params))
end
|
.uri(id = nil) ⇒ Object
31
32
33
|
# File 'lib/resources/document.rb', line 31
def self.uri(id=nil)
"/documents/#{id}"
end
|