class Spaceship::Tunes::Tester

def add_all_to_app!(app_id)

Parameters:
  • app_id (String) -- (required): The app id to filter the testers
def add_all_to_app!(app_id)
  all.each do |tester|
    begin
      tester.add_to_app!(app_id)
    rescue => ex
      if ex.to_s.include? "testerEmailExistsInternal" or ex.to_s.include? "duplicate.email"
        # That's a non-relevant error message by iTC
        # ignore that
      else
        raise ex
      end
    end
  end
end

def add_to_app!(app_id)

Parameters:
  • app_id (String) -- (required): The id of the application to which want to modify the list
def add_to_app!(app_id)
  client.add_tester_to_app!(self, app_id)
end

def all

Returns:
  • (Array) - Returns all beta testers available for this account
def all
  client.testers(self).map { |tester| self.factory(tester) }
end

def all_by_app(app_id)

Parameters:
  • app_id (String) -- (required): The app id to filter the testers

Returns:
  • (Array) - Returns all beta testers available for this account filtered by app
def all_by_app(app_id)
  client.testers_by_app(self, app_id).map { |tester| self.factory(tester) }
end

def create!(email: nil, first_name: nil, last_name: nil)

Returns:
  • (Tester) - : The newly created tester

Parameters:
  • last_name (String) -- (optional): The last name of the new tester
  • first_name (String) -- (optional): The first name of the new tester
  • email (String) -- (required): The email of the new tester
def create!(email: nil, first_name: nil, last_name: nil)
  data = client.create_tester!(tester: self,
                                email: email,
                           first_name: first_name,
                            last_name: last_name)
  self.factory(data)
end

def delete!

Delete current tester
def delete!
  client.delete_tester!(self)
end

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)
  self.new(attrs)
end

def find(identifier)

Parameters:
  • identifier (String) -- (required): Value used to filter the tester, case insensitive

Returns:
  • (Spaceship::Tunes::Tester) - Returns the tester matching the parameter
def find(identifier)
  all.find do |tester|
    (tester.tester_id.to_s.casecmp(identifier.to_s).zero? or tester.email.to_s.casecmp(identifier.to_s).zero?)
  end
end

def find_by_app(app_id, identifier)

Parameters:
  • identifier (String) -- (required): Value used to filter the tester, case insensitive
  • app_id (String) -- (required): The app id to filter the testers

Returns:
  • (Spaceship::Tunes::Tester) - Returns the tester matching the parameter
def find_by_app(app_id, identifier)
  all_by_app(app_id).find do |tester|
    (tester.tester_id.to_s.casecmp(identifier.to_s).zero? or tester.email.to_s.casecmp(identifier.to_s).zero?)
  end
end

def remove_from_app!(app_id)

Parameters:
  • app_id (String) -- (required): The id of the application to which want to modify the list
def remove_from_app!(app_id)
  client.remove_tester_from_app!(self, app_id)
end

def setup

def setup
  self.devices ||= [] # by default, an empty array instead of nil
end

def url

Returns:
  • (Hash) - All urls for the ITC used for web requests
def url
  raise "You have to use a subclass: Internal or External"
end