Class: DataCatalog::Favorite

Inherits:
Base
  • Object
show all
Defined in:
lib/resources/favorite.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, #method_missing, one, query_hash

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DataCatalog::Base

Class Method Details

.all(conditions = {}) ⇒ Object



5
6
7
# File 'lib/resources/favorite.rb', line 5

def self.all(conditions={})
  cursor(uri, query_hash(conditions))
end

.create(params = {}) ⇒ Object



9
10
11
# File 'lib/resources/favorite.rb', line 9

def self.create(params={})
  one(http_post(uri, :body => params))
end

.destroy(id) ⇒ Object



13
14
15
# File 'lib/resources/favorite.rb', line 13

def self.destroy(id)
  one(http_delete(uri(id)))
end

.get(id) ⇒ Object



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

def self.get(id)
  one(http_get(uri(id)))
end

.uri(id = nil) ⇒ Object

Helpers



23
24
25
# File 'lib/resources/favorite.rb', line 23

def self.uri(id=nil)
  "/favorites/#{id}"
end