Sha256: a9aa32ab259653f2f1cb131a0176cf4475bb53f7a83e62f7337851bed7345d83

Contents?: true

Size: 1.39 KB

Versions: 492

Compression:

Stored size: 1.39 KB

Contents

require_relative 'app_version_states_history'

module Spaceship
  module Tunes
    # Represents a read only version of an App Store Connect Versions State History
    class AppVersionHistory < TunesBase
      # @return (Spaceship::Tunes::Application) A reference to the application
      #   this version is for
      attr_accessor :application

      # @return (String) The version in string format (e.g. "1.0")
      attr_reader :version_string

      # @return (String) The platform value of this version.
      attr_reader :version_id

      # @return ([Spaceship::Tunes::AppVersionStatesHistory]) the array of version states
      attr_reader :items

      attr_mapping({
        'versionString' => :version_string,
        'versionId' => :version_id,
        'items' => :items
      })

      # Returns an array of all builds that can be sent to review
      def items
        @items ||= fetch_items
      end

      # Private methods
      def setup
        # Properly parse the AppStatus
        items = raw_data['items']
        @items = map_items(items) if items
      end

      private

      def map_items(items)
        items.map do |attrs|
          Tunes::AppVersionStatesHistory.factory(attrs)
        end
      end

      def fetch_items
        items = client.version_states_history(application.apple_id, application.platform, version_id)['items']
        map_items(items)
      end
    end
  end
end

Version data entries

492 entries across 492 versions & 5 rubygems

Version Path
fastlane-2.113.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190107200010 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190106200016 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190105200036 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190104200013 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190103200013 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190102200016 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20190101200013 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181231200027 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181230200014 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181229200101 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181228200027 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181227200058 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181226200116 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181225200026 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181224200038 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181223200038 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181222200027 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181221200014 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.113.0.beta.20181220200101 spaceship/lib/spaceship/tunes/app_version_history.rb