Class: Spaceship::Portal::Merchant
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::Merchant
- Defined in:
- spaceship/lib/spaceship/portal/merchant.rb
Overview
Represents a Merchant ID from the Developer Portal
Instance Attribute Summary collapse
-
#bundle_id ⇒ String
The bundle_id (merchant identifier) of merchant id.
-
#merchant_id ⇒ String
The identifier of this merchant, provided by the Dev Portal.
-
#name ⇒ String
The name you provided for this merchant.
-
#platform ⇒ String
The supported platform of this merchant.
-
#prefix ⇒ Object
Prefix provided by the Dev Portal.
-
#status ⇒ String
Status of the merchant.
Attributes inherited from Base
Class Method Summary collapse
-
.all(mac: false) ⇒ Array
Returns all merchants available for this account.
-
.create!(bundle_id: nil, name: nil, mac: false) ⇒ Merchant
Creates a new Merchant on the Apple Dev Portal.
-
.find(bundle_id, mac: false) ⇒ Merchant
Find a specific Merchant ID based on the bundle_id.
Instance Method Summary collapse
-
#delete! ⇒ Merchant
Delete this Merchant.
-
#mac? ⇒ Bool
Is this a Mac merchant?.
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 (merchant identifier) of merchant id.
30 31 32 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 30 def bundle_id @bundle_id end |
#merchant_id ⇒ String
Returns The identifier of this merchant, provided by the Dev Portal.
10 11 12 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 10 def merchant_id @merchant_id end |
#name ⇒ String
Returns The name you provided for this merchant.
15 16 17 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 15 def name @name end |
#platform ⇒ String
Returns the supported platform of this merchant.
20 21 22 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 20 def platform @platform end |
#prefix ⇒ Object
Prefix provided by the Dev Portal
25 26 27 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 25 def prefix @prefix end |
#status ⇒ String
Returns Status of the merchant.
35 36 37 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 35 def status @status end |
Class Method Details
.all(mac: false) ⇒ Array
Returns all merchants available for this account
48 49 50 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 48 def all(mac: false) client.merchants(mac: mac).map { |merchant| new(merchant) } end |
.create!(bundle_id: nil, name: nil, mac: false) ⇒ Merchant
Creates a new Merchant on the Apple Dev Portal
58 59 60 61 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 58 def create!(bundle_id: nil, name: nil, mac: false) new_merchant = client.create_merchant!(name, bundle_id, mac: mac) new(new_merchant) end |
.find(bundle_id, mac: false) ⇒ Merchant
Find a specific Merchant ID based on the bundle_id
66 67 68 69 70 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 66 def find(bundle_id, mac: false) all(mac: mac).find do |merchant| merchant.bundle_id == bundle_id end end |
Instance Method Details
#delete! ⇒ Merchant
Delete this Merchant
75 76 77 78 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 75 def delete! client.delete_merchant!(merchant_id, mac: mac?) self end |
#mac? ⇒ Bool
Returns Is this a Mac merchant?.
81 82 83 |
# File 'spaceship/lib/spaceship/portal/merchant.rb', line 81 def mac? platform == 'mac' end |