Class: Spaceship::App
Overview
Represents an App ID from the Developer Portal
Instance Attribute Summary collapse
-
#app_id ⇒ String
The identifier of this app, provided by the Dev Portal.
-
#bundle_id ⇒ String
The bundle_id (app identifier) of your app.
-
#dev_push_enabled ⇒ Bool
Development Push Enabled?.
-
#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?.
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.
Methods inherited from Base
attr_mapping, #client, #initialize, #inspect, method_missing, remap_keys!, set_client
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#app_id ⇒ String
Returns The identifier of this app, provided by the Dev Portal.
8 9 10 |
# File 'lib/spaceship/app.rb', line 8 def app_id @app_id end |
#bundle_id ⇒ String
Returns The bundle_id (app identifier) of your app.
28 29 30 |
# File 'lib/spaceship/app.rb', line 28 def bundle_id @bundle_id end |
#dev_push_enabled ⇒ Bool
Returns Development Push Enabled?.
34 35 36 |
# File 'lib/spaceship/app.rb', line 34 def dev_push_enabled @dev_push_enabled end |
#is_wildcard ⇒ Bool
Returns Is this app a wildcard app (e.g. com.krausefx.*).
31 32 33 |
# File 'lib/spaceship/app.rb', line 31 def is_wildcard @is_wildcard end |
#name ⇒ String
Returns The name you provided for this app.
13 14 15 |
# File 'lib/spaceship/app.rb', line 13 def name @name end |
#platform ⇒ String
Returns the supported platform of this app.
18 19 20 |
# File 'lib/spaceship/app.rb', line 18 def platform @platform end |
#prefix ⇒ Object
Prefix provided by the Dev Portal
23 24 25 |
# File 'lib/spaceship/app.rb', line 23 def prefix @prefix end |
#prod_push_enabled ⇒ Bool
Returns Production Push Enabled?.
37 38 39 |
# File 'lib/spaceship/app.rb', line 37 def prod_push_enabled @prod_push_enabled end |
Class Method Details
.all ⇒ Array
Returns all apps available for this account
58 59 60 |
# File 'lib/spaceship/app.rb', line 58 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
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/spaceship/app.rb', line 68 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.
53 54 55 |
# File 'lib/spaceship/app.rb', line 53 def factory(attrs) self.new(attrs) end |
.find(bundle_id) ⇒ App
Find a specific App ID based on the bundle_id
81 82 83 84 85 |
# File 'lib/spaceship/app.rb', line 81 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
91 92 93 94 |
# File 'lib/spaceship/app.rb', line 91 def delete! client.delete_app!(app_id) self end |