Sha256: 4df64b6a8d1c23263c5dffa4e443825e18873f71ce9d7a12e9437f95079c96e0

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

require_relative 'tunes_base'

module Spaceship
  module Tunes
    # Represents an image hosted on App Store Connect. Used for app store review attachment file.
    class AppReviewAttachment < TunesBase
      HOST_URL = "https://iosapps-ssl.itunes.apple.com/itunes-assets"

      attr_accessor :asset_token

      attr_accessor :original_file_name

      attr_accessor :url

      attr_accessor :type_of_file

      attr_mapping(
        'assetToken' => :asset_token,
        'fileType' => :type_of_file,
        'url' => :url,
        'name' => :original_file_name
      )

      def reset!(attrs = {})
        update_raw_data!(
          {
            asset_token: nil,
            type_of_file: nil,
            url: nil,
            original_file_name: 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}"
      end

      private

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastlane_hotfix-2.165.1 spaceship/lib/spaceship/tunes/app_review_attachment.rb
fastlane_hotfix-2.165.0 spaceship/lib/spaceship/tunes/app_review_attachment.rb
fastlane_hotfix-2.187.0 spaceship/lib/spaceship/tunes/app_review_attachment.rb