Module: Kameleoon::OperatingSystemType

Defined in:
lib/kameleoon/data/operating_system.rb

Constant Summary collapse

WINDOWS =
0
MAC =
1
IOS =
2
LINUX =
3
ANDROID =
4
WINDOWS_PHONE =
5

Class Method Summary collapse

Class Method Details

.from_name(name) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/kameleoon/data/operating_system.rb', line 12

def self.from_name(name)
  case name
  when 'WINDOWS'
    WINDOWS
  when 'MAC'
    MAC
  when 'IOS'
    IOS
  when 'LINUX'
    LINUX
  when 'ANDROID'
    ANDROID
  when 'WINDOWS_PHONE'
    WINDOWS_PHONE
  else
    nil
  end
end

.name_from_type(operating_system_type) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/kameleoon/data/operating_system.rb', line 31

def self.name_from_type(operating_system_type)
  case operating_system_type
  when OperatingSystemType::WINDOWS
    'WINDOWS'
  when OperatingSystemType::MAC
    'MAC'
  when OperatingSystemType::IOS
    'IOS'
  when OperatingSystemType::LINUX
    'LINUX'
  when OperatingSystemType::ANDROID
    'ANDROID'
  when OperatingSystemType::WINDOWS_PHONE
    'WINDOWS_PHONE'
  else
    nil
  end
end