Class: Spaceship::Portal::AppGroup
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::AppGroup
- Defined in:
- lib/spaceship/portal/app_group.rb
Overview
Represents an app group of the Apple Dev Portal
Instance Attribute Summary collapse
-
#app_group_id ⇒ String
The identifier of this app group, provided by the Dev Portal.
-
#group_id ⇒ String
The identifier assigned to this group.
-
#name ⇒ String
The name of this group.
-
#prefix ⇒ String
The prefix assigned to this group.
-
#status ⇒ String
Status of the group.
Attributes inherited from Base
Class Method Summary collapse
-
.all ⇒ Array
Returns all app groups available for this account.
-
.create!(group_id: nil, name: nil) ⇒ AppGroup
Creates a new App Group on the Apple Dev Portal.
-
.factory(attrs) ⇒ Object
Create a new object based on a hash.
-
.find(group_id) ⇒ AppGroup
Find a specific App Group group_id.
Instance Method Summary collapse
-
#delete! ⇒ AppGroup
Delete this app group.
Methods inherited from Spaceship::PortalBase
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_group_id ⇒ String
Returns The identifier of this app group, provided by the Dev Portal.
28 29 30 |
# File 'lib/spaceship/portal/app_group.rb', line 28 def app_group_id @app_group_id end |
#group_id ⇒ String
Returns The identifier assigned to this group.
8 9 10 |
# File 'lib/spaceship/portal/app_group.rb', line 8 def group_id @group_id end |
#name ⇒ String
Returns The name of this group.
18 19 20 |
# File 'lib/spaceship/portal/app_group.rb', line 18 def name @name end |
#prefix ⇒ String
Returns The prefix assigned to this group.
13 14 15 |
# File 'lib/spaceship/portal/app_group.rb', line 13 def prefix @prefix end |
#status ⇒ String
Returns Status of the group.
23 24 25 |
# File 'lib/spaceship/portal/app_group.rb', line 23 def status @status end |
Class Method Details
.all ⇒ Array
Returns all app groups available for this account
46 47 48 |
# File 'lib/spaceship/portal/app_group.rb', line 46 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
55 56 57 58 |
# File 'lib/spaceship/portal/app_group.rb', line 55 def create!(group_id: nil, name: nil) new_group = client.create_app_group!(name, group_id) self.new(new_group) 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.
41 42 43 |
# File 'lib/spaceship/portal/app_group.rb', line 41 def factory(attrs) self.new(attrs) end |
.find(group_id) ⇒ AppGroup
Find a specific App Group group_id
62 63 64 65 66 |
# File 'lib/spaceship/portal/app_group.rb', line 62 def find(group_id) all.find do |group| group.group_id == group_id end end |
Instance Method Details
#delete! ⇒ AppGroup
Delete this app group
71 72 73 74 |
# File 'lib/spaceship/portal/app_group.rb', line 71 def delete! client.delete_app_group!(app_group_id) self end |