Class: Podio::View
Overview
Instance Attribute Summary
#attributes
Class Method Summary
collapse
#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, has_many, has_one, #hash, #initialize, #initialize_attributes, klass_from_string, list, member, #new_record?, output_attribute_as_json, #parent_model, #persisted?, property, #to_param
Class Method Details
.create(app_id, attributes) ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/podio/models/view.rb', line 44
def create(app_id, attributes)
response = Podio.connection.post do |req|
req.url "/view/app/#{app_id}/"
req.body = attributes
end
member response.body
end
|
.delete(view_id) ⇒ Object
39
40
41
|
# File 'lib/podio/models/view.rb', line 39
def delete(view_id)
Podio.connection.delete("/view/#{view_id}").status
end
|
.find(id, app_id = nil) ⇒ Object
32
33
34
35
36
|
# File 'lib/podio/models/view.rb', line 32
def find(id, app_id=nil)
path = app_id ? "/view/app/#{app_id}/#{id}" : "/view/#{id}"
member Podio.connection.get(path).body
end
|
.find_all(app_id, options = {}) ⇒ Object
25
26
27
28
29
|
# File 'lib/podio/models/view.rb', line 25
def find_all(app_id, options={})
list Podio.connection.get { |req|
req.url("/view/app/#{app_id}/", options)
}.body
end
|
.find_last(app_id) ⇒ Object
20
21
22
|
# File 'lib/podio/models/view.rb', line 20
def find_last(app_id)
member Podio.connection.get("/view/app/#{app_id}/last").body
end
|
.make_default(view_id) ⇒ Object
72
73
74
|
# File 'lib/podio/models/view.rb', line 72
def make_default(view_id)
Podio.connection.post("/view/#{view_id}/default").status
end
|
.update(view_id, attributes) ⇒ Object
54
55
56
57
58
59
60
61
|
# File 'lib/podio/models/view.rb', line 54
def update(view_id, attributes)
response = Podio.connection.put do |req|
req.url "/view/#{view_id}"
req.body = attributes
end
response.status
end
|
.update_last(app_id, attributes) ⇒ Object
64
65
66
67
68
69
|
# File 'lib/podio/models/view.rb', line 64
def update_last(app_id, attributes)
Podio.connection.put do |req|
req.url "/view/app/#{app_id}/last"
req.body = attributes
end
end
|