Sha256: 7ce440536385e6c516bcf7bb3aa7226121565e712ced70aec74307518eafd57b

Contents?: true

Size: 1.12 KB

Versions: 482

Compression:

Stored size: 1.12 KB

Contents

require_relative 'tunes_base'

module Spaceship
  module Tunes
    # Represents an image hosted on App Store Connect. Used for icons, screenshots, etc
    class AppImage < TunesBase
      HOST_URL = "https://is1-ssl.mzstatic.com/image/thumb"

      attr_accessor :asset_token

      attr_accessor :sort_order

      attr_accessor :original_file_name

      attr_accessor :url

      attr_accessor :is_imessage

      attr_mapping(
        'assetToken' => :asset_token,
        'sortOrder' => :sort_order,
        'url' => :url,
        'originalFileName' => :original_file_name
      )

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

      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

      private

      def update_raw_data!(hash)
        hash.each do |k, v|
          self.send("#{k}=", v)
        end
      end
    end
  end
end

Version data entries

482 entries across 482 versions & 5 rubygems

Version Path
fastlane-2.116.0.beta.20190205200046 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190204200009 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190203200034 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190202200022 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190201200019 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190131200016 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190130200045 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190129200025 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.116.0.beta.20190128200102 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190127200030 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190126200102 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190125200019 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190124200016 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190123200015 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190122200028 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190120200101 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190119200019 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190118200015 spaceship/lib/spaceship/tunes/app_image.rb
fastlane-2.115.0.beta.20190117200016 spaceship/lib/spaceship/tunes/app_image.rb