Class: Spaceship::TestFlight::Tester
- Defined in:
- spaceship/lib/spaceship/test_flight/tester.rb
Instance Attribute Summary collapse
-
#email ⇒ String
The email of this tester.
-
#first_name ⇒ String
The first name of this tester.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#last_name ⇒ String
The last name of this tester.
-
#latest_install_info ⇒ Hash
{ “latestInstalledAppAdamId”: “1222374686”, “latestInstalledBuildId”: “20739770”, “latestInstalledDate”: “1496866405755”, “latestInstalledShortVersion”: “1.0”, “latestInstalledVersion”: “68” }.
-
#latest_installed_date ⇒ Object
Returns the value of attribute latest_installed_date.
-
#session_count ⇒ Integer
Number of sessions.
- #status ⇒ String
-
#status_mod_time ⇒ Integer
Date of the last modification of the status (e.g. invite sent).
-
#tester_id ⇒ String
The identifier of this tester, provided by App Store Connect.
Attributes inherited from Base
Class Method Summary collapse
-
.all(app_id: nil) ⇒ Array
Returns all beta testers available for this account.
- .create_app_level_tester(app_id: nil, first_name: nil, last_name: nil, email: nil) ⇒ Object
-
.find(app_id: nil, email: nil) ⇒ Object
*DEPRECATED: Use ‘Spaceship::TestFlight::Tester.search` method instead*.
- .remove_testers_from_testflight(app_id: nil, tester_ids: nil) ⇒ Object
-
.search(app_id: nil, text: nil, is_email_exact_match: false) ⇒ Spaceship::TestFlight::Tester
ITC searches all fields, and is full text.
Instance Method Summary collapse
- #pretty_install_date ⇒ Object
- #remove_from_app!(app_id: nil) ⇒ Object
- #remove_from_testflight!(app_id: nil) ⇒ Object
- #resend_invite(app_id: nil) ⇒ Object
Methods inherited from Base
Methods inherited from Base
attr_accessor, attr_mapping, attributes, #attributes, factory, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#email ⇒ String
Returns The email of this tester.
14 15 16 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 14 def email @email end |
#first_name ⇒ String
Returns The first name of this tester.
19 20 21 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 19 def first_name @first_name end |
#groups ⇒ Object
Returns the value of attribute groups.
52 53 54 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 52 def groups @groups end |
#last_name ⇒ String
Returns The last name of this tester.
24 25 26 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 24 def last_name @last_name end |
#latest_install_info ⇒ Hash
"latestInstalledAppAdamId": "1222374686",
"latestInstalledBuildId": "20739770",
"latestInstalledDate": "1496866405755",
"latestInstalledShortVersion": "1.0",
"latestInstalledVersion": "68"
45 46 47 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 45 def latest_install_info @latest_install_info end |
#latest_installed_date ⇒ Object
Returns the value of attribute latest_installed_date.
47 48 49 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 47 def latest_installed_date @latest_installed_date end |
#session_count ⇒ Integer
Returns Number of sessions.
50 51 52 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 50 def session_count @session_count end |
#status ⇒ String
31 32 33 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 31 def status @status end |
#status_mod_time ⇒ Integer
Returns Date of the last modification of the status (e.g. invite sent).
34 35 36 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 34 def status_mod_time @status_mod_time end |
#tester_id ⇒ String
Returns The identifier of this tester, provided by App Store Connect.
9 10 11 |
# File 'spaceship/lib/spaceship/test_flight/tester.rb', line 9 def tester_id @tester_id end |
Class Method Details
.all(app_id: nil) ⇒ Array
Returns all beta testers available for this account
81 82 83 |
# 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) ⇒ Object
116 117 118 119 120 121 |
# 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) ⇒ Object
*DEPRECATED: Use ‘Spaceship::TestFlight::Tester.search` method instead*
86 87 88 89 |
# 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) ⇒ Object
112 113 114 |
# 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) ⇒ Spaceship::TestFlight::Tester
ITC searches all fields, and is full text. The search results are the union of all words in the search text
98 99 100 101 102 103 104 105 106 107 108 109 110 |
# 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 |
Instance Method Details
#pretty_install_date ⇒ Object
74 75 76 77 78 |
# 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) ⇒ Object
123 124 125 |
# 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) ⇒ Object
127 128 129 |
# 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) ⇒ Object
131 132 133 |
# 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 |