Class: DeviceDetector::OS
Constant Summary
Constants inherited
from Parser
Parser::ROOT
Instance Attribute Summary
Attributes inherited from Parser
#user_agent
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Parser
#initialize
Class Method Details
.mapped_os_version(version, mapping) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/device_detector/os.rb', line 8
def mapped_os_version(version, mapping)
return if version.nil?
major_version = version.split('.').first
mapping[version] || mapping[major_version]
end
|
Instance Method Details
#desktop? ⇒ Boolean
29
30
31
|
# File 'lib/device_detector/os.rb', line 29
def desktop?
DESKTOP_OSS.include?(family)
end
|
#family ⇒ Object
25
26
27
|
# File 'lib/device_detector/os.rb', line 25
def family
os_info[:family]
end
|
#full_version ⇒ Object
33
34
35
36
|
# File 'lib/device_detector/os.rb', line 33
def full_version
raw_version = super.to_s.split('_').join('.')
raw_version == '' ? nil : raw_version
end
|
#name ⇒ Object
17
18
19
|
# File 'lib/device_detector/os.rb', line 17
def name
os_info[:name]
end
|
#short_name ⇒ Object
21
22
23
|
# File 'lib/device_detector/os.rb', line 21
def short_name
os_info[:short]
end
|