Class: Spaceship::Tunes::SandboxTester
- Defined in:
- spaceship/lib/spaceship/tunes/sandbox_tester.rb
Instance Attribute Summary collapse
-
#country ⇒ String
The two-letter country code of this tester.
-
#email ⇒ String
The email of this sandbox tester.
-
#first_name ⇒ String
The first name of this tester.
-
#last_name ⇒ String
The last name of this tester.
Attributes inherited from Base
Subclasses collapse
-
#delete! ⇒ Object
Delete current tester.
Class Method Summary collapse
- .all ⇒ Object
- .create!(email: nil, password: nil, first_name: 'Test', last_name: 'Test', country: 'US') ⇒ Object
- .delete!(emails) ⇒ Object
- .delete_all! ⇒ Object
- .url ⇒ Object
Methods inherited from TunesBase
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
#country ⇒ String
Returns The two-letter country code of this tester.
24 25 26 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 24 def country @country end |
#email ⇒ String
Returns The email of this sandbox tester.
9 10 11 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 9 def email @email end |
#first_name ⇒ String
Returns The first name of this tester.
14 15 16 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 14 def first_name @first_name end |
#last_name ⇒ String
Returns The last name of this tester.
19 20 21 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 19 def last_name @last_name end |
Class Method Details
.all ⇒ Object
41 42 43 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 41 def self.all client.sandbox_testers(self).map { |tester| self.new(tester) } end |
.create!(email: nil, password: nil, first_name: 'Test', last_name: 'Test', country: 'US') ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 45 def self.create!(email: nil, password: nil, first_name: 'Test', last_name: 'Test', country: 'US') data = client.create_sandbox_tester!( tester_class: self, email: email, password: password, first_name: first_name, last_name: last_name, country: country ) self.new(data) end |
.delete!(emails) ⇒ Object
57 58 59 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 57 def self.delete!(emails) client.delete_sandbox_testers!(self, emails) end |
.delete_all! ⇒ Object
61 62 63 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 61 def self.delete_all! delete!(self.all.map(&:email)) end |
.url ⇒ Object
33 34 35 36 37 38 39 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 33 def self.url { index: "ra/users/iap", create: "ra/users/iap/add", delete: "ra/users/iap/delete" } end |
Instance Method Details
#delete! ⇒ Object
Delete current tester
69 70 71 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 69 def delete! client.delete_tester!(self) end |