Class: Podio::Form
Instance Attribute Summary
#attributes, #error_code, #error_message, #error_parameters, #error_propagate
Class Method Summary
collapse
#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, list, member, #new_record?, #persisted?, property, #to_param
Class Method Details
.create(app_id, attributes) ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/podio/models/form.rb', line 19
def create(app_id, attributes)
response = Podio.connection.post do |req|
req.url "/form/app/#{app_id}/"
req.body = attributes
end
response.body['form_id']
end
|
.disable(form_id) ⇒ Object
47
48
49
|
# File 'lib/podio/models/form.rb', line 47
def disable(form_id)
Podio.connection.post("/form/#{form_id}/deactivate").body
end
|
.enable(form_id) ⇒ Object
51
52
53
|
# File 'lib/podio/models/form.rb', line 51
def enable(form_id)
Podio.connection.post("/form/#{form_id}/activate").body
end
|
.find(form_id) ⇒ Object
43
44
45
|
# File 'lib/podio/models/form.rb', line 43
def find(form_id)
member Podio.connection.get("/form/#{form_id}").body
end
|
.find_all_for_app(app_id) ⇒ Object
37
38
39
40
41
|
# File 'lib/podio/models/form.rb', line 37
def find_all_for_app(app_id)
list Podio.connection.get { |req|
req.url("/form/app/#{app_id}/")
}.body
end
|
.update(form_id, attributes) ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/podio/models/form.rb', line 28
def update(form_id, attributes)
response = Podio.connection.put do |req|
req.url "/form/#{form_id}"
req.body = attributes
end
response.status
end
|