Class: Spaceship::Tunes::AppImage

Inherits:
TunesBase show all
Defined in:
spaceship/lib/spaceship/tunes/app_image.rb

Overview

Represents an image hosted on App Store Connect. Used for icons, screenshots, etc

Direct Known Subclasses

AppScreenshot

Constant Summary collapse

HOST_URL =
"https://is1-ssl.mzstatic.com/image/thumb"

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Instance Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, attributes, #attributes, factory, #initialize, #inspect, mapping_module, method_missing, set_client, #to_s

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#asset_tokenObject

Returns the value of attribute asset_token.



9
10
11
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 9

def asset_token
  @asset_token
end

#is_imessageObject

Returns the value of attribute is_imessage.



17
18
19
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 17

def is_imessage
  @is_imessage
end

#original_file_nameObject

Returns the value of attribute original_file_name.



13
14
15
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 13

def original_file_name
  @original_file_name
end

#sort_orderObject

Returns the value of attribute sort_order.



11
12
13
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 11

def sort_order
  @sort_order
end

#urlObject

Returns the value of attribute url.



15
16
17
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 15

def url
  @url
end

Instance Method Details

#reset!(attrs = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 26

def reset!(attrs = {})
  update_raw_data!(
    {
      asset_token: nil,
      original_file_name: nil,
      sort_order: nil,
      url: nil
    }.merge(attrs)
  )
end

#setupObject



37
38
39
40
# File 'spaceship/lib/spaceship/tunes/app_image.rb', line 37

def setup
  # Since September 2015 we don't get the url anymore, so we have to manually build it
  self.url = "#{HOST_URL}/#{self.asset_token}/0x0ss.jpg"
end