Class: Spaceship::Portal::Passbook
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::Passbook
- Defined in:
- spaceship/lib/spaceship/portal/passbook.rb
Overview
Represents an Passbook ID from the Developer Portal
Instance Attribute Summary collapse
-
#bundle_id ⇒ String
The bundle_id (passbook) of passbook id.
-
#name ⇒ String
The name you provided for this passbook.
-
#passbook_id ⇒ String
The identifier of this passbook, provided by the Dev Portal.
-
#platform ⇒ String
The supported platform of this passbook.
-
#prefix ⇒ Object
Prefix provided by the Dev Portal.
-
#status ⇒ String
Status of the passbook.
Attributes inherited from Base
Class Method Summary collapse
-
.all ⇒ Array
Returns all passbook available for this account.
-
.create!(bundle_id: nil, name: nil) ⇒ Passbook
Creates a new Passbook ID on the Apple Dev Portal.
-
.find(bundle_id) ⇒ Passbook
Find a specific Passbook ID based on the bundle_id.
Instance Method Summary collapse
-
#delete! ⇒ Passbook
Delete this Passbook ID.
Methods inherited from Spaceship::PortalBase
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
#bundle_id ⇒ String
Returns The bundle_id (passbook) of passbook id.
30 31 32 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 30 def bundle_id @bundle_id end |
#name ⇒ String
Returns The name you provided for this passbook.
15 16 17 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 15 def name @name end |
#passbook_id ⇒ String
Returns The identifier of this passbook, provided by the Dev Portal.
10 11 12 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 10 def passbook_id @passbook_id end |
#platform ⇒ String
Returns the supported platform of this passbook.
20 21 22 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 20 def platform @platform end |
#prefix ⇒ Object
Prefix provided by the Dev Portal
25 26 27 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 25 def prefix @prefix end |
#status ⇒ String
Returns Status of the passbook.
35 36 37 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 35 def status @status end |
Class Method Details
.all ⇒ Array
Returns all passbook available for this account
47 48 49 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 47 def all client.passbooks.map { |pass_type| self.new(pass_type) } end |
.create!(bundle_id: nil, name: nil) ⇒ Passbook
Creates a new Passbook ID on the Apple Dev Portal
56 57 58 59 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 56 def create!(bundle_id: nil, name: nil) new_passbook = client.create_passbook!(name, bundle_id) self.new(new_passbook) end |
.find(bundle_id) ⇒ Passbook
Find a specific Passbook ID based on the bundle_id
63 64 65 66 67 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 63 def find(bundle_id) all.find do |passbook| passbook.bundle_id == bundle_id end end |
Instance Method Details
#delete! ⇒ Passbook
Delete this Passbook ID.
72 73 74 75 |
# File 'spaceship/lib/spaceship/portal/passbook.rb', line 72 def delete! client.delete_passbook!(passbook_id) self end |