Class: Podio::AppStoreShare

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/app_store_share.rb

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes, #error_code, #error_message, #error_parameters, #error_propagate

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, list, member, #new_record?, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.create(attributes) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/podio/models/app_store_share.rb', line 46

def create(attributes)
  response = Podio.connection.post do |req|
    req.url "/app_store/"
    req.body = attributes
  end

  response.body['share_id']
end

.find(id) ⇒ Object



64
65
66
# File 'lib/podio/models/app_store_share.rb', line 64

def find(id)
  member Podio.connection.get("/app_store/#{id}/v2").body
end

.find_all_private_for_org(org_id) ⇒ Object



68
69
70
# File 'lib/podio/models/app_store_share.rb', line 68

def find_all_private_for_org(org_id)
  list Podio.connection.get("/app_store/org/#{org_id}/").body['shares']
end

.install(share_id, space_id, dependencies) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/podio/models/app_store_share.rb', line 55

def install(share_id, space_id, dependencies)
  response = Podio.connection.post do |req|
    req.url "/app_store/#{share_id}/install/v2"
    req.body = {:space_id => space_id, :dependencies => dependencies}
  end

  response.body
end

Instance Method Details

#api_friendly_ref_typeObject



41
42
43
# File 'lib/podio/models/app_store_share.rb', line 41

def api_friendly_ref_type
  'share'
end

#createObject



31
32
33
# File 'lib/podio/models/app_store_share.rb', line 31

def create
  self.share_id = self.class.create(self.attributes)
end

#install(space_id, dependencies) ⇒ Object



35
36
37
# File 'lib/podio/models/app_store_share.rb', line 35

def install(space_id, dependencies)
  self.class.install(self.share_id, space_id, dependencies)
end