Class: Spaceship::Tunes::DisplayFamily
- Inherits:
-
Object
- Object
- Spaceship::Tunes::DisplayFamily
- Defined in:
- spaceship/lib/spaceship/tunes/display_family.rb
Overview
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).
Instance Attribute Summary collapse
-
#friendly_category_name ⇒ Object
The user friendly category for this definition (i.e iPhone, Apple TV or Desktop).
-
#friendly_name ⇒ Object
The user friendly name of this definition.
-
#messages_picture_type ⇒ Object
Similar to ‘picture_type`, but for iMessage screenshots.
-
#name ⇒ Object
The display family name from the App Store Connect API that is used when uploading or listing screenshots.
-
#picture_type ⇒ Object
An internal identifier for the same device definition used in the DUClient.
-
#screenshot_resolutions ⇒ Object
An array of supported screen resolutions (in pixels) that are supported for the associated device.
Class Method Summary collapse
-
.all ⇒ Object
All DisplayFamily types currently supported by App Store Connect.
-
.find(name) ⇒ Object
Finds a DisplayFamily definition.
- .lookup ⇒ Object
Instance Method Summary collapse
-
#messages_supported? ⇒ Boolean
Identifies if the device definition supports iMessage screenshots.
Instance Attribute Details
#friendly_category_name ⇒ Object
The user friendly category for this definition (i.e iPhone, Apple TV or Desktop).
25 26 27 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 25 def friendly_category_name @friendly_category_name end |
#friendly_name ⇒ Object
The user friendly name of this definition.
Source: Media Manager in App Store Connect.
21 22 23 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 21 def friendly_name @friendly_name end |
#messages_picture_type ⇒ Object
Similar to ‘picture_type`, but for iMessage screenshots.
43 44 45 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 43 def @messages_picture_type end |
#name ⇒ Object
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.
16 17 18 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 16 def name @name end |
#picture_type ⇒ Object
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.
40 41 42 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 40 def picture_type @picture_type end |
#screenshot_resolutions ⇒ Object
An array of supported screen resolutions (in pixels) that are supported for the associated device.
31 32 33 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 31 def screenshot_resolutions @screenshot_resolutions end |
Class Method Details
.all ⇒ Object
All DisplayFamily types currently supported by App Store Connect.
60 61 62 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 60 def self.all lookup.values end |
.find(name) ⇒ Object
Finds a DisplayFamily definition.
54 55 56 57 |
# 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 |
.lookup ⇒ Object
66 67 68 69 70 |
# 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 |
Instance Method Details
#messages_supported? ⇒ Boolean
Identifies if the device definition supports iMessage screenshots.
46 47 48 |
# File 'spaceship/lib/spaceship/tunes/display_family.rb', line 46 def true unless .nil? end |