Class: Spaceship::Tunes::SandboxTester

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

App collapse

Attributes inherited from Base

#client, #raw_data

App 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



211
212
213
# File 'lib/spaceship/tunes/tester.rb', line 211

def country
  @country
end

#emailString

Returns The email of this tester.

Examples:

"[email protected]"

Returns:

  • (String)

    The email of this tester



196
197
198
# File 'lib/spaceship/tunes/tester.rb', line 196

def email
  @email
end

#first_nameString

Returns The first name of this tester.

Examples:

"Cary"

Returns:

  • (String)

    The first name of this tester



201
202
203
# File 'lib/spaceship/tunes/tester.rb', line 201

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



206
207
208
# File 'lib/spaceship/tunes/tester.rb', line 206

def last_name
  @last_name
end

Class Method Details

.allObject



228
229
230
# File 'lib/spaceship/tunes/tester.rb', line 228

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



232
233
234
235
236
237
238
239
240
241
242
# File 'lib/spaceship/tunes/tester.rb', line 232

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



244
245
246
# File 'lib/spaceship/tunes/tester.rb', line 244

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

.delete_all!Object



248
249
250
# File 'lib/spaceship/tunes/tester.rb', line 248

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

.urlObject



220
221
222
223
224
225
226
# File 'lib/spaceship/tunes/tester.rb', line 220

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