class Spaceship::Tunes::AppVersionHistory

Represents a read only version of an iTunes Connect Versions State History

def factory(attrs)

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

def fetch_items

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

def items

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

def map_items(items)

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

def setup

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