lib/spaceship/tunes/tester.rb in spaceship-0.3.4 vs lib/spaceship/tunes/tester.rb in spaceship-0.4.0
- old
+ new
@@ -1,26 +1,26 @@
module Spaceship
module Tunes
class Tester < TunesBase
# @return (String) The identifier of this tester, provided by iTunes Connect
- # @example
+ # @example
# "60f858b4-60a8-428a-963a-f943a3d68d17"
attr_accessor :tester_id
# @return (String) The email of this tester
- # @example
+ # @example
# "tester@spaceship.com"
attr_accessor :email
-
+
# @return (String) The first name of this tester
- # @example
+ # @example
# "Cary"
attr_accessor :first_name
# @return (String) The last name of this tester
- # @example
+ # @example
# "Bennett"
attr_accessor :last_name
# @return (Array) An array of registered devices for this user
# @example
@@ -30,11 +30,10 @@
# "osVersion": "8.3",
# "name": null
# }]
attr_accessor :devices
-
# Information about the most recent beta install
# @return [Integer] The ID of the most recently installed app
attr_accessor :latest_install_app_id
# @return [Integer] Date of the last install of this tester
@@ -54,11 +53,11 @@
'lastName.value' => :last_name,
'devices' => :devices,
'latestInstalledAppAdamId' => :latest_install_app_id,
'latestInstalledDate' => :latest_install_date,
'latestInstalledVersion' => :latest_installed_version_number,
- 'latestInstalledShortVersion' => :latest_installed_build_number,
+ 'latestInstalledShortVersion' => :latest_installed_build_number
)
class << self
# @return (Hash) All urls for the ITC used for web requests
@@ -88,14 +87,14 @@
# Create new tester in iTunes Connect
# @param email (String) (required): The email of the new tester
# @param first_name (String) (optional): The first name of the new tester
# @param last_name (String) (optional): The last name of the new tester
- # @example
+ # @example
# Spaceship::Tunes::Tester.external.create!(email: "tester@mathiascarignani.com", first_name: "Cary", last_name:"Bennett")
# @return (Tester): The newly created tester
- def create!(email: nil, first_name: nil, last_name: nil)
+ def create!(email: nil, first_name: nil, last_name: nil)
data = client.create_tester!(tester: self,
email: email,
first_name: first_name,
last_name: last_name)
self.factory(data)
@@ -105,11 +104,11 @@
# @!group App
#####################################################
# @return (Array) Returns all beta testers available for this account filtered by app
# @param app_id (String) (required): The app id to filter the testers
- def all_by_app(app_id)
+ def all_by_app(app_id)
client.testers_by_app(self, app_id).map { |tester| self.factory(tester) }
end
# @return (Spaceship::Tunes::Tester) Returns the tester matching the parameter
# as either the Tester id or email
@@ -126,11 +125,11 @@
def add_all_to_app!(app_id)
all.each do |tester|
begin
tester.add_to_app!(app_id)
rescue => ex
- if ex.to_s.include?"testerEmailExistsInternal" or ex.to_s.include?"duplicate.email"
+ if ex.to_s.include? "testerEmailExistsInternal" or ex.to_s.include? "duplicate.email"
# That's a non-relevant error message by iTC
# ignore that
else
raise ex
end
@@ -144,11 +143,11 @@
end
#####################################################
# @!group Subclasses
#####################################################
- class External < Tester
+ class External < Tester
def self.url(app_id = nil)
{
index: "ra/users/pre/ext",
index_by_app: "ra/user/externalTesters/#{app_id}/",
create: "ra/users/pre/create",
@@ -156,11 +155,11 @@
update_by_app: "ra/user/externalTesters/#{app_id}/"
}
end
end
- class Internal < Tester
+ class Internal < Tester
def self.url(app_id = nil)
{
index: "ra/users/pre/int",
index_by_app: "ra/user/internalTesters/#{app_id}/",
create: nil,
@@ -169,11 +168,11 @@
}
end
end
# Delete current tester
- def delete!
+ def delete!
client.delete_tester!(self)
end
#####################################################
# @!group App
@@ -190,6 +189,6 @@
def remove_from_app!(app_id)
client.remove_tester_from_app!(self, app_id)
end
end
end
-end
\ No newline at end of file
+end