class Spaceship::Portal::App

Represents an App ID from the Developer Portal

def all(mac: false)

Returns:
  • (Array) - Returns all apps available for this account

Parameters:
  • mac (Bool) -- Fetches Mac apps if true
def all(mac: false)
  client.apps(mac: mac).map { |app| self.factory(app) }
end

def associate_groups(groups)

Returns:
  • (App) - The updated detailed app. This is nil if the app couldn't be found
def associate_groups(groups)
  raise "`associate_groups` not available for Mac apps" if mac?
  app = client.associate_groups_with_app(self, groups)
  self.class.factory(app)
end

def create!(bundle_id: nil, name: nil, mac: false)

Returns:
  • (App) - The app you just created

Parameters:
  • mac (Bool) -- is this a Mac app?
  • name (String) -- the name of the App
  • bundle_id (String) -- the bundle id (app_identifier) of the app associated with this provisioning profile
def create!(bundle_id: nil, name: nil, mac: false)
  if bundle_id.end_with?('*')
    type = :wildcard
  else
    type = :explicit
  end
  new_app = client.create_app!(type, name, bundle_id, mac: mac)
  self.new(new_app)
end

def delete!

Returns:
  • (App) - The app you just deletd
def delete!
  client.delete_app!(app_id, mac: mac?)
  self
end

def details

Returns:
  • (App) - The app you're looking for. This is nil if the app can't be found.
def details
  app = client.details_for_app(self)
  self.class.factory(app)
end

def factory(attrs)

This is used to create a new object based on the server response.
Create a new object based on a hash.
def factory(attrs)
  self.new(attrs)
end

def find(bundle_id, mac: false)

Returns:
  • (App) - The app you're looking for. This is nil if the app can't be found.

Parameters:
  • mac (Bool) -- Searches Mac apps if true
def find(bundle_id, mac: false)
  all(mac: mac).find do |app|
    app.bundle_id == bundle_id
  end
end

def mac?

Returns:
  • (Bool) - Is this a Mac app?
def mac?
  platform == 'mac'
end

def update_service(service)

Returns:
  • (App) - The updated detailed app. This is nil if the app couldn't be found
def update_service(service)
  raise "`update_service` not implemented for Mac apps" if mac?
  app = client.update_service_for_app(self, service)
  self.class.factory(app)
end