Class: Spaceship::Portal::App

Inherits:
Spaceship::PortalBase show all
Defined in:
lib/spaceship/portal/app.rb

Overview

Represents an App ID from the Developer Portal

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Spaceship::PortalBase

client

Methods inherited from Base

attr_accessor, attr_mapping, #attributes, attributes, #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_countFixnum



46
47
48
# File 'lib/spaceship/portal/app.rb', line 46

def app_groups_count
  @app_groups_count
end

#app_idString

Returns The identifier of this app, provided by the Dev Portal.

Examples:

"RGAWZGXSAA"


8
9
10
# File 'lib/spaceship/portal/app.rb', line 8

def app_id
  @app_id
end

#bundle_idString

Returns The bundle_id (app identifier) of your app.

Examples:

"com.krausefx.app"


28
29
30
# File 'lib/spaceship/portal/app.rb', line 28

def bundle_id
  @bundle_id
end

#cloud_containers_countFixnum



49
50
51
# File 'lib/spaceship/portal/app.rb', line 49

def cloud_containers_count
  @cloud_containers_count
end

#dev_push_enabledBool



40
41
42
# File 'lib/spaceship/portal/app.rb', line 40

def dev_push_enabled
  @dev_push_enabled
end

#enabled_featuresArray



37
38
39
# File 'lib/spaceship/portal/app.rb', line 37

def enabled_features
  @enabled_features
end

#featuresHash



34
35
36
# File 'lib/spaceship/portal/app.rb', line 34

def features
  @features
end

#identifiers_countFixnum



52
53
54
# File 'lib/spaceship/portal/app.rb', line 52

def identifiers_count
  @identifiers_count
end

#is_wildcardBool



31
32
33
# File 'lib/spaceship/portal/app.rb', line 31

def is_wildcard
  @is_wildcard
end

#nameString

Returns The name you provided for this app.

Examples:

"Spaceship"


13
14
15
# File 'lib/spaceship/portal/app.rb', line 13

def name
  @name
end

#platformString

Returns the supported platform of this app.

Examples:

"ios"


18
19
20
# File 'lib/spaceship/portal/app.rb', line 18

def platform
  @platform
end

#prefixObject

Prefix provided by the Dev Portal

Examples:

"5A997XSHK2"


23
24
25
# File 'lib/spaceship/portal/app.rb', line 23

def prefix
  @prefix
end

#prod_push_enabledBool



43
44
45
# File 'lib/spaceship/portal/app.rb', line 43

def prod_push_enabled
  @prod_push_enabled
end

Class Method Details

.allArray



78
79
80
# File 'lib/spaceship/portal/app.rb', line 78

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



88
89
90
91
92
93
94
95
96
97
# File 'lib/spaceship/portal/app.rb', line 88

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.



73
74
75
# File 'lib/spaceship/portal/app.rb', line 73

def factory(attrs)
  self.new(attrs)
end

.find(bundle_id) ⇒ App

Find a specific App ID based on the bundle_id



101
102
103
104
105
# File 'lib/spaceship/portal/app.rb', line 101

def find(bundle_id)
  all.find do |app|
    app.bundle_id == bundle_id
  end
end

Instance Method Details

#associate_groups(groups) ⇒ App

Associate specific groups with this app



125
126
127
128
# File 'lib/spaceship/portal/app.rb', line 125

def associate_groups(groups)
  app = client.associate_groups_with_app(self, groups)
  self.class.factory(app)
end

#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



111
112
113
114
# File 'lib/spaceship/portal/app.rb', line 111

def delete!
  client.delete_app!(app_id)
  self
end

#detailsApp

Fetch a specific App ID details based on the bundle_id



118
119
120
121
# File 'lib/spaceship/portal/app.rb', line 118

def details
  app = client.details_for_app(self)
  self.class.factory(app)
end

#update_service(service) ⇒ App

Update a service for the app with given AppService object



132
133
134
135
# File 'lib/spaceship/portal/app.rb', line 132

def update_service(service)
  app = client.update_service_for_app(self, service)
  self.class.factory(app)
end