class Spaceship::TestFlight::Tester
Attributes
email[RW]
@return (String
) The email of this tester @example
"tester@spaceship.com"
first_name[RW]
@return (String
) The first name of this tester @example
"Cary"
groups[RW]
last_name[RW]
@return (String
) The last name of this tester @example
"Bennett"
latest_install_info[RW]
@return (Hash
) @example {
"latestInstalledAppAdamId": "1222374686", "latestInstalledBuildId": "20739770", "latestInstalledDate": "1496866405755", "latestInstalledShortVersion": "1.0", "latestInstalledVersion": "68"
}
latest_installed_date[RW]
session_count[RW]
@return (Integer) Number of sessions
status[RW]
@return (String
) @example
"invited" "installed"
status_mod_time[RW]
@return (Integer) Date of the last modification of the status (e.g. invite sent)
Public Class Methods
all(app_id: nil)
click to toggle source
@return (Array
) Returns all beta testers available for this account
# File spaceship/lib/spaceship/test_flight/tester.rb, line 81 def self.all(app_id: nil) client.testers_for_app(app_id: app_id).map { |data| self.new(data) } end
create_app_level_tester(app_id: nil, first_name: nil, last_name: nil, email: nil)
click to toggle source
# File spaceship/lib/spaceship/test_flight/tester.rb, line 116 def self.create_app_level_tester(app_id: nil, first_name: nil, last_name: nil, email: nil) client.create_app_level_tester(app_id: app_id, first_name: first_name, last_name: last_name, email: email) end
find(app_id: nil, email: nil)
click to toggle source
*DEPRECATED: Use `Spaceship::TestFlight::Tester.search` method instead*
# File spaceship/lib/spaceship/test_flight/tester.rb, line 86 def self.find(app_id: nil, email: nil) testers = self.search(app_id: app_id, text: email, is_email_exact_match: true) return testers.first end
remove_testers_from_testflight(app_id: nil, tester_ids: nil)
click to toggle source
# File spaceship/lib/spaceship/test_flight/tester.rb, line 112 def self.remove_testers_from_testflight(app_id: nil, tester_ids: nil) client.remove_testers_from_testflight(app_id: app_id, tester_ids: tester_ids) end
search(app_id: nil, text: nil, is_email_exact_match: false)
click to toggle source
@return (Spaceship::TestFlight::Tester
) Returns the testers matching the parameter. ITC searches all fields, and is full text. The search results are the union of all words in the search text @param text (String
) (required): Value used to filter the tester, case insensitive
# File spaceship/lib/spaceship/test_flight/tester.rb, line 98 def self.search(app_id: nil, text: nil, is_email_exact_match: false) text = text.strip testers_matching_text = client.search_for_tester_in_app(app_id: app_id, text: text).map { |data| self.new(data) } testers_matching_text ||= [] if is_email_exact_match text = text.downcase testers_matching_text = testers_matching_text.select do |tester| tester.email.downcase == text end end return testers_matching_text end
Public Instance Methods
pretty_install_date()
click to toggle source
# File spaceship/lib/spaceship/test_flight/tester.rb, line 74 def pretty_install_date return nil unless latest_installed_date Time.at((latest_installed_date / 1000)).strftime("%Y-%m-%d %H:%M") end
remove_from_app!(app_id: nil)
click to toggle source
# File spaceship/lib/spaceship/test_flight/tester.rb, line 123 def remove_from_app!(app_id: nil) client.delete_tester_from_app(app_id: app_id, tester_id: self.tester_id) end
remove_from_testflight!(app_id: nil)
click to toggle source
# File spaceship/lib/spaceship/test_flight/tester.rb, line 127 def remove_from_testflight!(app_id: nil) client.remove_testers_from_testflight(app_id: app_id, tester_ids: [self.tester_id]) end
resend_invite(app_id: nil)
click to toggle source
# File spaceship/lib/spaceship/test_flight/tester.rb, line 131 def resend_invite(app_id: nil) client.resend_invite_to_external_tester(app_id: app_id, tester_id: self.tester_id) end