-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# frozen_string_literal: true | ||
|
||
module Zealot::Mock | ||
class AppleDevice | ||
DEVICES = { | ||
MAC_OS: [ | ||
'macOS' | ||
], | ||
IOS: [ | ||
'iPhone', | ||
'iPhone 3GS', | ||
'iPhone 4', | ||
'iPhone 4s', | ||
'iPhone 5', | ||
'iPhone 5s', | ||
'iPhone 5 SE', | ||
'iPhone 6', | ||
'iPhone 6s', | ||
'iPhone 7', | ||
'iPhone 8', | ||
'iPhone 8 Plus', | ||
'iPhone X', | ||
'iPhone XS', | ||
'iPhone XS Max', | ||
'iPhone XR', | ||
'iPhone 11', | ||
'iPhone 11 Pro', | ||
'iPhone 11 Pro Max', | ||
'iPhone 12', | ||
'iPhone 12 mini', | ||
'iPhone 12 Pro', | ||
'iPhone 12 Pro Max', | ||
'iPhone 13', | ||
'iPhone 13 mini', | ||
'iPhone 13 Pro', | ||
'iPhone 13 Pro Max', | ||
'iPhone 14', | ||
'iPhone 14 Pro', | ||
'iPhone 14 Pro Max', | ||
'iPhone 15', | ||
'iPhone 15 Pro', | ||
'iPhone 15 Pro Max', | ||
'iPhone 16', | ||
'iPhone 16 Pro', | ||
'iPhone 16 Pro Max', | ||
] | ||
} | ||
|
||
class << self | ||
def platform | ||
devices[Random.rand(devices.size)] | ||
end | ||
|
||
def model(name) | ||
models = DEVICES[name.to_sym] | ||
range = models.size | ||
models[range == 1 ? 0 : Random.rand(range)] | ||
end | ||
|
||
private | ||
|
||
def devices | ||
@devices ||= DEVICES.keys | ||
end | ||
end | ||
end | ||
end |
Binary file not shown.
Binary file not shown.
Binary file not shown.