Class: Podio::OrganizationProfile
Overview
Encapsulates an organization profile, primarily used for in app store
Instance Attribute Summary
#attributes, #error_code, #error_message, #error_parameters, #error_propagate
Class Method Summary
collapse
Instance Method Summary
collapse
#remove_nil_values, #update_attributes
#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, #initialize_attributes, list, member, #new_record?, output_attribute_as_json, #persisted?, property, #to_param
Class Method Details
.create(org_id, attributes) ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/podio/models/organization_profile.rb', line 44
def create(org_id, attributes)
response = Podio.connection.post do |req|
req.url "/org/#{org_id}/appstore"
req.body = attributes
end
response.body
end
|
.delete(org_id) ⇒ Object
61
62
63
|
# File 'lib/podio/models/organization_profile.rb', line 61
def delete(org_id)
Podio.connection.delete("/org/#{org_id}/appstore").status
end
|
.find(org_id) ⇒ Object
36
37
38
|
# File 'lib/podio/models/organization_profile.rb', line 36
def find(org_id)
member Podio.connection.get("/org/#{org_id}/appstore").body
end
|
.find_by_url(url_label) ⇒ Object
40
41
42
|
# File 'lib/podio/models/organization_profile.rb', line 40
def find_by_url(url_label)
member Podio.connection.get("/app_store/org/#{url_label}/profile").body
end
|
.update(org_id, attributes) ⇒ Object
53
54
55
56
57
58
59
|
# File 'lib/podio/models/organization_profile.rb', line 53
def update(org_id, attributes)
response = Podio.connection.put do |req|
req.url "/org/#{org_id}/appstore"
req.body = attributes
end
response.status
end
|
Instance Method Details
#create ⇒ Object
21
22
23
|
# File 'lib/podio/models/organization_profile.rb', line 21
def create
self.class.create(self.org_id, self.attributes)
end
|
#destroy ⇒ Object
29
30
31
|
# File 'lib/podio/models/organization_profile.rb', line 29
def destroy
self.class.delete(self.org_id)
end
|
#update ⇒ Object
25
26
27
|
# File 'lib/podio/models/organization_profile.rb', line 25
def update
self.class.update(self.org_id, self.attributes)
end
|