Class: Spaceship::Portal::CloudContainer

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

Overview

Represents an iCloud Container of the Apple Dev Portal

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class 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

#can_deleteBool

Returns Is the container deletable?.

Returns:

  • (Bool)

    Is the container deletable?



36
37
38
# File 'spaceship/lib/spaceship/portal/cloud_container.rb', line 36

def can_delete
  @can_delete
end

#can_editBool

Returns Is the container editable?.

Returns:

  • (Bool)

    Is the container editable?



33
34
35
# File 'spaceship/lib/spaceship/portal/cloud_container.rb', line 33

def can_edit
  @can_edit
end

#cloud_containerString

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

Examples:

"2MAY7NPHAA"

Returns:

  • (String)

    The identifier of this iCloud container, provided by the Dev Portal



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

def cloud_container
  @cloud_container
end

#identifierString

Returns The identifier assigned to this container.

Examples:

"iCloud.com.example.application"

Returns:

  • (String)

    The identifier assigned to this container



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

def identifier
  @identifier
end

#nameString

Returns The name of this container.

Examples:

"iCloud com example application"

Returns:

  • (String)

    The name of this container



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

def name
  @name
end

#prefixString

Returns The prefix assigned to this container.

Examples:

"9J57U9392R"

Returns:

  • (String)

    The prefix assigned to this container



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

def prefix
  @prefix
end

#statusString

Returns Status of the container.

Examples:

"current"

Returns:

  • (String)

    Status of the container



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

def status
  @status
end

Class Method Details

.allArray

Returns all iCloud containers available for this account

Returns:

  • (Array)

    Returns all iCloud containers available for this account



50
51
52
# File 'spaceship/lib/spaceship/portal/cloud_container.rb', line 50

def all
  client.cloud_containers.map { |container| self.factory(container) }
end

.create!(identifier: nil, name: nil) ⇒ CloudContainer

Creates a new iCloud Container on the Apple Dev Portal

Parameters:

  • identifier (String) (defaults to: nil)

    the identifier to assign to this container

  • name (String) (defaults to: nil)

    the name of the container

Returns:



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

def create!(identifier: nil, name: nil)
  new_container = client.create_cloud_container!(name, identifier)
  self.new(new_container)
end

.find(identifier) ⇒ CloudContainer

Find a specific iCloud Container identifier

Returns:

  • (CloudContainer)

    The iCloud Container you’re looking for. This is nil if the container can’t be found.



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

def find(identifier)
  all.find do |container|
    container.identifier == identifier
  end
end