Class: Spaceship::Tunes::SandboxTester

Inherits:
TunesBase show all
Defined in:
lib/spaceship/tunes/tester.rb

Helpers collapse

Attributes inherited from Base

#client, #raw_data

Helpers collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, #attributes, attributes, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#countryString

Returns The two-letter country code of this tester.

Examples:

"US"

Returns:

  • (String)

    The two-letter country code of this tester



241
242
243
# File 'lib/spaceship/tunes/tester.rb', line 241

def country
  @country
end

#emailString

Returns The email of this tester.

Examples:

"[email protected]"

Returns:

  • (String)

    The email of this tester



226
227
228
# File 'lib/spaceship/tunes/tester.rb', line 226

def email
  @email
end

#first_nameString

Returns The first name of this tester.

Examples:

"Cary"

Returns:

  • (String)

    The first name of this tester



231
232
233
# File 'lib/spaceship/tunes/tester.rb', line 231

def first_name
  @first_name
end

#last_nameString

Returns The last name of this tester.

Examples:

"Bennett"

Returns:

  • (String)

    The last name of this tester



236
237
238
# File 'lib/spaceship/tunes/tester.rb', line 236

def last_name
  @last_name
end

Class Method Details

.allObject



258
259
260
# File 'lib/spaceship/tunes/tester.rb', line 258

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



262
263
264
265
266
267
268
269
270
271
272
# File 'lib/spaceship/tunes/tester.rb', line 262

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



274
275
276
# File 'lib/spaceship/tunes/tester.rb', line 274

def self.delete!(emails)
  client.delete_sandbox_testers!(self, emails)
end

.delete_all!Object



278
279
280
# File 'lib/spaceship/tunes/tester.rb', line 278

def self.delete_all!
  delete!(self.all.map(&:email))
end

.urlObject



250
251
252
253
254
255
256
# File 'lib/spaceship/tunes/tester.rb', line 250

def self.url
  {
    index:  "ra/users/iap",
    create: "ra/users/iap/add",
    delete: "ra/users/iap/delete"
  }
end