class Spaceship::Portal::Passbook

Represents an Passbook ID from the Developer Portal

Attributes

bundle_id[RW]

@return (String) The bundle_id (passbook) of passbook id @example

"web.com.krausefx.app"
name[RW]

@return (String) The name you provided for this passbook @example

"Spaceship"
passbook_id[RW]

@return (String) The identifier of this passbook, provided by the Dev Portal @example

"RGAWZGXSAA"
platform[RW]

@return (String) the supported platform of this passbook @example

"ios"
prefix[RW]

Prefix provided by the Dev Portal @example

"5A997XSHK2"
status[RW]

@return (String) Status of the passbook @example

"current"

Public Class Methods

all() click to toggle source

@return (Array) Returns all passbook available for this account

# 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) click to toggle source

Creates a new Passbook ID on the Apple Dev Portal

@param bundle_id [String] the bundle id (Passbook_id) of the passbook @param name [String] the name of the Passbook @return (Passbook) The Passbook you just created

# 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) click to toggle source

Find a specific Passbook ID based on the bundle_id @return (Passbook) The passbook you're looking for. This is nil if the passbook can't be found.

# File spaceship/lib/spaceship/portal/passbook.rb, line 63
def find(bundle_id)
  all.find do |passbook|
    passbook.bundle_id == bundle_id
  end
end

Public Instance Methods

delete!() click to toggle source

Delete this Passbook ID. @return (Passbook) The passbook you just deleted

# File spaceship/lib/spaceship/portal/passbook.rb, line 72
def delete!
  client.delete_passbook!(passbook_id)
  self
end