Class: Spaceship::Tunes::AppImage

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

Overview

Represents an image hosted on iTunes 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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, #attributes, attributes, #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.



7
8
9
# File 'lib/spaceship/tunes/app_image.rb', line 7

def asset_token
  @asset_token
end

#is_imessageObject

Returns the value of attribute is_imessage.



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

def is_imessage
  @is_imessage
end

#original_file_nameObject

Returns the value of attribute original_file_name.



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

def original_file_name
  @original_file_name
end

#sort_orderObject

Returns the value of attribute sort_order.



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

def sort_order
  @sort_order
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Class Method Details

.factory(attrs) ⇒ Object



25
26
27
# File 'lib/spaceship/tunes/app_image.rb', line 25

def factory(attrs)
  self.new(attrs)
end

Instance Method Details

#reset!(attrs = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/spaceship/tunes/app_image.rb', line 30

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

#setupObject



41
42
43
44
# File 'lib/spaceship/tunes/app_image.rb', line 41

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