class Spaceship::Tunes::DisplayFamily

A definition of different styled displays used by devices that App Store Connect supports storing screenshots. Display styles often only vary based on screen resolution however other aspects of a displays physical appearance are also factored (i.e if the home indicator is provided via a hardware button or a software interface).

Attributes

friendly_category_name[RW]

The user friendly category for this definition (i.e iPhone, Apple TV or Desktop).

friendly_name[RW]

The user friendly name of this definition.

Source: Media Manager in App Store Connect.

messages_picture_type[RW]

Similar to `picture_type`, but for iMessage screenshots.

name[RW]

The display family name from the App Store Connect API that is used when uploading or listing screenshots. This value is then assigned to the Spaceship::Tunes::AppScreenshot#device_type attribute.

picture_type[RW]

An internal identifier for the same device definition used in the DUClient.

Source: You can find this by uploading an image in App Store Connect using your browser and then look for the X-Apple-Upload-Validation-RuleSets value in the uploads request headers.

screenshot_resolutions[RW]

An array of supported screen resolutions (in pixels) that are supported for the associated device.

Source: help.apple.com/app-store-connect/#/devd274dd925

Public Class Methods

all() click to toggle source

All DisplayFamily types currently supported by App Store Connect.

# File spaceship/lib/spaceship/tunes/display_family.rb, line 60
def self.all
  lookup.values
end
find(name) click to toggle source

Finds a DisplayFamily definition.

@param name (Symbol|String) The name of the display family being searched for. @return DisplayFamily object matching the given name.

# File spaceship/lib/spaceship/tunes/display_family.rb, line 54
def self.find(name)
  name = name.to_sym if name.kind_of?(String)
  lookup[name]
end
new(data) click to toggle source
# File spaceship/lib/spaceship/tunes/display_family.rb, line 74
def initialize(data)
  @name = data["name"]
  @friendly_name = data["friendly_name"]
  @friendly_category_name = data["friendly_category_name"]
  @screenshot_resolutions = data["screenshot_resolutions"]
  @picture_type = data["picture_type"]
  @messages_picture_type = data["messages_picture_type"]
end

Private Class Methods

lookup() click to toggle source
# File spaceship/lib/spaceship/tunes/display_family.rb, line 66
def self.lookup
  return @lookup if defined?(@lookup)
  display_families = JSON.parse(File.read(File.join(Spaceship::ROOT, "lib", "assets", "displayFamilies.json")))
  @lookup ||= display_families.map { |data| [data["name"].to_sym, DisplayFamily.new(data)] }.to_h
end

Public Instance Methods

messages_supported?() click to toggle source

Identifies if the device definition supports iMessage screenshots.

# File spaceship/lib/spaceship/tunes/display_family.rb, line 46
def messages_supported?
  true unless messages_picture_type.nil?
end