Sha256: 4791d5411b0db54304b9664d4f6a8de62d40367683c2fdfdaba1321be27d19c5

Contents?: true

Size: 1.58 KB

Versions: 76

Compression:

Stored size: 1.58 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
      })

      class << self
        # Create a new object based on a hash.
        # This is used to create a new object based on the server response.
        def factory(attrs)
          obj = self.new(attrs)
          return obj
        end
      end

      # 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

76 entries across 76 versions & 2 rubygems

Version Path
fastlane-2.14.2 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.14.1 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.14.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.13.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.12.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.11.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.10.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.9.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.8.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.7.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.6.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.5.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.4.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.3.1 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.3.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.2.0 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.1.3 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.1.2 spaceship/lib/spaceship/tunes/app_version_history.rb
fastlane-2.1.1 spaceship/lib/spaceship/tunes/app_version_history.rb
spaceship-1.0.0 lib/spaceship/tunes/app_version_history.rb