Class: Spaceship::Portal::AppService

Inherits:
Object
  • Object
show all
Defined in:
spaceship/lib/spaceship/portal/app_service.rb

Overview

Represents a single application service (its state to be more precise) on the Apple Dev Portal

Constant Summary collapse

AccessWifi =
AppService.new_service("AWEQ28MY3E")
AppGroup =
AppService.new_service("APG3427HIY")
ApplePay =
AppService.new_service("OM633U5T5G")
AssociatedDomains =
AppService.new_service("SKC3T5S89Y")
ClassKit =
AppService.new_service("PKTJAN2017")
AutoFillCredential =
AppService.new_service("CPEQ28MX4E")
DataProtection =
AppService.new_service("dataProtection", values: { off: "", complete: "complete", unless_open: "unlessopen", until_first_auth: "untilfirstauth" })
GameCenter =
AppService.new_service("gameCenter")
HealthKit =
AppService.new_service("HK421J6T7P")
HomeKit =
AppService.new_service("homeKit")
Hotspot =
AppService.new_service("HSC639VEI8")
Cloud =
AppService.new_service("iCloud")
CloudKit =
AppService.new_service("cloudKitVersion", values: { xcode5_compatible: 1, cloud_kit: 2 })
InAppPurchase =
AppService.new_service("inAppPurchase")
InterAppAudio =
AppService.new_service("IAD53UNK2F")
Multipath =
AppService.new_service("MP49FN762P")
NetworkExtension =
AppService.new_service("NWEXT04537")
NFCTagReading =
AppService.new_service("NFCTRMAY17")
PersonalVPN =
AppService.new_service("V66P55NK2I")
Passbook =
AppService.new_service("passbook")
PushNotification =
AppService.new_service("push")
SiriKit =
AppService.new_service("SI015DKUHP")
VPNConfiguration =
AppService.new_service("V66P55NK2I")
Wallet =
AppService.new_service("passbook")
WirelessAccessory =
AppService.new_service("WC421J6T7P")

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_id, value) ⇒ AppService

Returns a new instance of AppService.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'spaceship/lib/spaceship/portal/app_service.rb', line 20

def initialize(service_id, value)
  @service_id = service_id
  @value = value

  if @service_id == "push"
    # Push notifications have a special URI
    @service_uri = "account/ios/identifiers/updatePushService.action"
  else
    # Default service URI
    @service_uri = "account/ios/identifiers/updateService.action"
  end
end

Instance Attribute Details

#service_idString

Returns The identifier used by the Dev Portal to represent this service.

Examples:

"homeKit"

Returns:

  • (String)

    The identifier used by the Dev Portal to represent this service



8
9
10
# File 'spaceship/lib/spaceship/portal/app_service.rb', line 8

def service_id
  @service_id
end

#service_uriString

Returns The service URI for this service.

Examples:

"account/ios/identifiers/updateService.action"

Returns:

  • (String)

    The service URI for this service



18
19
20
# File 'spaceship/lib/spaceship/portal/app_service.rb', line 18

def service_uri
  @service_uri
end

#valueObject

Returns The current value for this service.

Examples:

false

Returns:

  • (Object)

    The current value for this service



13
14
15
# File 'spaceship/lib/spaceship/portal/app_service.rb', line 13

def value
  @value
end

Class Method Details

.new_service(id, values: { on: true, off: false }) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'spaceship/lib/spaceship/portal/app_service.rb', line 33

def self.new_service(id, values: { on: true, off: false })
  m = Module.new
  values.each do |k, v|
    m.define_singleton_method(k) do
      AppService.new(id, v)
    end
  end
  return m
end

Instance Method Details

#==(other) ⇒ Object



79
80
81
82
83
84
# File 'spaceship/lib/spaceship/portal/app_service.rb', line 79

def ==(other)
  self.class == other.class &&
    self.service_id == other.service_id &&
    self.value == other.value &&
    self.service_uri == other.service_uri
end