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
permalink #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 |
permalink #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 |
Class Method Details
permalink .all ⇒ Object
[View source]
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 |
permalink .create!(email: nil, password: nil, first_name: 'Test', last_name: 'Test', country: 'US') ⇒ Object
[View source]
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 |
permalink .delete!(emails) ⇒ Object
[View source]
57 58 59 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 57 def self.delete!(emails) client.delete_sandbox_testers!(self, emails) end |
permalink .delete_all! ⇒ Object
[View source]
61 62 63 |
# File 'spaceship/lib/spaceship/tunes/sandbox_tester.rb', line 61 def self.delete_all! delete!(self.all.map(&:email)) end |
permalink .url ⇒ Object
[View source]
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
permalink #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 |