Class: Spaceship::Portal::App
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::App
- Defined in:
- lib/spaceship/portal/app.rb
Overview
Represents an App ID from the Developer Portal
Instance Attribute Summary collapse
-
#app_groups_count ⇒ Fixnum
Number of associated app groups.
-
#app_id ⇒ String
The identifier of this app, provided by the Dev Portal.
-
#bundle_id ⇒ String
The bundle_id (app identifier) of your app.
-
#cloud_containers_count ⇒ Fixnum
Number of associated cloud containers.
-
#dev_push_enabled ⇒ Bool
Development Push Enabled?.
-
#enabled_features ⇒ Array
List of enabled features.
-
#features ⇒ Hash
Feature details.
-
#identifiers_count ⇒ Fixnum
Number of associated identifiers.
-
#is_wildcard ⇒ Bool
Is this app a wildcard app (e.g. com.krausefx.*).
-
#name ⇒ String
The name you provided for this app.
-
#platform ⇒ String
The supported platform of this app.
-
#prefix ⇒ Object
Prefix provided by the Dev Portal.
-
#prod_push_enabled ⇒ Bool
Production Push Enabled?.
Attributes inherited from Base
Class Method Summary collapse
-
.all ⇒ Array
Returns all apps available for this account.
-
.create!(bundle_id: nil, name: nil) ⇒ App
Creates a new App ID on the Apple Dev Portal.
-
.factory(attrs) ⇒ Object
Create a new object based on a hash.
-
.find(bundle_id) ⇒ App
Find a specific App ID based on the bundle_id.
Instance Method Summary collapse
-
#delete! ⇒ App
Delete this App ID.
-
#details ⇒ App
Fetch a specific App ID details based on the bundle_id.
Methods inherited from Spaceship::PortalBase
Methods inherited from Base
attr_accessor, attr_mapping, attributes, #attributes, #client, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#app_groups_count ⇒ Fixnum
Returns Number of associated app groups.
47 48 49 |
# File 'lib/spaceship/portal/app.rb', line 47 def app_groups_count @app_groups_count end |
#app_id ⇒ String
Returns The identifier of this app, provided by the Dev Portal.
9 10 11 |
# File 'lib/spaceship/portal/app.rb', line 9 def app_id @app_id end |
#bundle_id ⇒ String
Returns The bundle_id (app identifier) of your app.
29 30 31 |
# File 'lib/spaceship/portal/app.rb', line 29 def bundle_id @bundle_id end |
#cloud_containers_count ⇒ Fixnum
Returns Number of associated cloud containers.
50 51 52 |
# File 'lib/spaceship/portal/app.rb', line 50 def cloud_containers_count @cloud_containers_count end |
#dev_push_enabled ⇒ Bool
Returns Development Push Enabled?.
41 42 43 |
# File 'lib/spaceship/portal/app.rb', line 41 def dev_push_enabled @dev_push_enabled end |
#enabled_features ⇒ Array
Returns List of enabled features.
38 39 40 |
# File 'lib/spaceship/portal/app.rb', line 38 def enabled_features @enabled_features end |
#features ⇒ Hash
Returns Feature details.
35 36 37 |
# File 'lib/spaceship/portal/app.rb', line 35 def features @features end |
#identifiers_count ⇒ Fixnum
Returns Number of associated identifiers.
53 54 55 |
# File 'lib/spaceship/portal/app.rb', line 53 def identifiers_count @identifiers_count end |
#is_wildcard ⇒ Bool
Returns Is this app a wildcard app (e.g. com.krausefx.*).
32 33 34 |
# File 'lib/spaceship/portal/app.rb', line 32 def is_wildcard @is_wildcard end |
#name ⇒ String
Returns The name you provided for this app.
14 15 16 |
# File 'lib/spaceship/portal/app.rb', line 14 def name @name end |
#platform ⇒ String
Returns the supported platform of this app.
19 20 21 |
# File 'lib/spaceship/portal/app.rb', line 19 def platform @platform end |
#prefix ⇒ Object
Prefix provided by the Dev Portal
24 25 26 |
# File 'lib/spaceship/portal/app.rb', line 24 def prefix @prefix end |
#prod_push_enabled ⇒ Bool
Returns Production Push Enabled?.
44 45 46 |
# File 'lib/spaceship/portal/app.rb', line 44 def prod_push_enabled @prod_push_enabled end |
Class Method Details
.all ⇒ Array
Returns all apps available for this account
79 80 81 |
# File 'lib/spaceship/portal/app.rb', line 79 def all client.apps.map { |app| self.factory(app) } end |
.create!(bundle_id: nil, name: nil) ⇒ App
Creates a new App ID on the Apple Dev Portal
if bundle_id ends with ‘*’ then it is a wildcard id otherwise, it is an explicit id
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/spaceship/portal/app.rb', line 89 def create!(bundle_id: nil, name: nil) if bundle_id.end_with?('*') type = :wildcard else type = :explicit end new_app = client.create_app!(type, name, bundle_id) self.new(new_app) end |
.factory(attrs) ⇒ Object
Create a new object based on a hash. This is used to create a new object based on the server response.
74 75 76 |
# File 'lib/spaceship/portal/app.rb', line 74 def factory(attrs) self.new(attrs) end |
.find(bundle_id) ⇒ App
Find a specific App ID based on the bundle_id
102 103 104 105 106 |
# File 'lib/spaceship/portal/app.rb', line 102 def find(bundle_id) all.find do |app| app.bundle_id == bundle_id end end |
Instance Method Details
#delete! ⇒ App
Delete this App ID. This action will most likely fail if the App ID is already in the store or there are active profiles
112 113 114 115 |
# File 'lib/spaceship/portal/app.rb', line 112 def delete! client.delete_app!(app_id) self end |
#details ⇒ App
Fetch a specific App ID details based on the bundle_id
119 120 121 122 |
# File 'lib/spaceship/portal/app.rb', line 119 def details app = client.details_for_app(self) self.class.factory(app) end |