Class: Podio::OrganizationProfile
Overview
Encapsulates an organization profile, primarily used for in app store
Instance Attribute Summary
#attributes
Class Method Summary
collapse
Instance Method Summary
collapse
#remove_nil_values, #update_attributes
#==, #[], #[]=, #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(org_id, attributes) ⇒ Object
48
49
50
51
52
53
54
55
|
# File 'lib/podio/models/organization_profile.rb', line 48
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
67
68
69
|
# File 'lib/podio/models/organization_profile.rb', line 67
def delete(org_id)
Podio.connection.delete("/org/#{org_id}/appstore").status
end
|
.find(org_id) ⇒ Object
39
40
41
|
# File 'lib/podio/models/organization_profile.rb', line 39
def find(org_id)
member Podio.connection.get("/org/#{org_id}/appstore").body
end
|
.find_by_url(url_label) ⇒ Object
43
44
45
|
# File 'lib/podio/models/organization_profile.rb', line 43
def find_by_url(url_label)
member Podio.connection.get("/app_store/org/#{url_label}/profile").body
end
|
.update(org_id, attributes) ⇒ Object
58
59
60
61
62
63
64
|
# File 'lib/podio/models/organization_profile.rb', line 58
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
23
24
25
|
# File 'lib/podio/models/organization_profile.rb', line 23
def create
self.class.create(self.org_id, self.attributes)
end
|
#destroy ⇒ Object
33
34
35
|
# File 'lib/podio/models/organization_profile.rb', line 33
def destroy
self.class.delete(self.org_id)
end
|
#update ⇒ Object
28
29
30
|
# File 'lib/podio/models/organization_profile.rb', line 28
def update
self.class.update(self.org_id, self.attributes)
end
|