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
The user friendly category for this definition (i.e iPhone, Apple TV or Desktop).
The user friendly name of this definition.
Source: Media Manager in App
Store Connect.
Similar to `picture_type`, but for iMessage screenshots.
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.
An array of supported screen resolutions (in pixels) that are supported for the associated device.
Public Class Methods
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
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
# 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
# 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
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