Class: Spaceship::Portal::AppGroup

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

Overview

Represents an app group of the Apple Dev 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, factory, #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_group_idString

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

Examples:

"2MAY7NPHAA"

Returns:

  • (String)

    The identifier of this app group, provided by the Dev Portal



30
31
32
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 30

def app_group_id
  @app_group_id
end

#group_idString

Returns The identifier assigned to this group.

Examples:

"group.com.example.application"

Returns:

  • (String)

    The identifier assigned to this group



10
11
12
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 10

def group_id
  @group_id
end

#nameString

Returns The name of this group.

Examples:

"App Group"

Returns:

  • (String)

    The name of this group



20
21
22
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 20

def name
  @name
end

#prefixString

Returns The prefix assigned to this group.

Examples:

"9J57U9392R"

Returns:

  • (String)

    The prefix assigned to this group



15
16
17
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 15

def prefix
  @prefix
end

#statusString

Returns Status of the group.

Examples:

"current"

Returns:

  • (String)

    Status of the group



25
26
27
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 25

def status
  @status
end

Class Method Details

.allArray

Returns all app groups available for this account

Returns:

  • (Array)

    Returns all app groups available for this account



42
43
44
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 42

def all
  client.app_groups.map { |group| self.factory(group) }
end

.create!(group_id: nil, name: nil) ⇒ AppGroup

Creates a new App Group on the Apple Dev Portal

Parameters:

  • group_id (String) (defaults to: nil)

    the identifier to assign to this group

  • name (String) (defaults to: nil)

    the name of the group

Returns:

  • (AppGroup)

    The group you just created



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

def create!(group_id: nil, name: nil)
  new_group = client.create_app_group!(name, group_id)
  self.new(new_group)
end

.find(group_id) ⇒ AppGroup

Find a specific App Group group_id

Returns:

  • (AppGroup)

    The app group you’re looking for. This is nil if the app group can’t be found.



58
59
60
61
62
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 58

def find(group_id)
  all.find do |group|
    group.group_id == group_id
  end
end

Instance Method Details

#delete!AppGroup

Delete this app group

Returns:

  • (AppGroup)

    The app group you just deletd



67
68
69
70
# File 'spaceship/lib/spaceship/portal/app_group.rb', line 67

def delete!
  client.delete_app_group!(app_group_id)
  self
end