Sha256: 1f2165717220fc0a52c3d921c8cb67bfc1e32e0a65d0ab749e29c6aa2935acae

Contents?: true

Size: 1.34 KB

Versions: 431

Compression:

Stored size: 1.34 KB

Contents

module Spaceship
  module Tunes
    # Represents a read only version of an iTunes 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

431 entries across 431 versions & 1 rubygems

Version Path
fastlane-2.22.0.beta.20170321010023 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.21.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.21.0.beta.20170320010043 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.21.0.beta.20170319010027 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.21.0.beta.20170318010107 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.21.0.beta.20170317010039 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.21.0.beta.20170316010039 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170315010053 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170314010029 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170313010048 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170312010035 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170311010030 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170310010058 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170309010049 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170308010036 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.19.3 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170307010029 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.19.2 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.20.0.beta.20170306010752 spaceship/lib/spaceship/tunes/app_version_history.rb