Class: DeviceDetector::OS

Inherits:
Parser
  • Object
show all
Defined in:
lib/device_detector/os.rb

Constant Summary

Constants inherited from Parser

Parser::ROOT

Instance Attribute Summary

Attributes inherited from Parser

#user_agent

Instance Method Summary collapse

Methods inherited from Parser

#initialize

Constructor Details

This class inherits a constructor from DeviceDetector::Parser

Instance Method Details

#desktop?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/device_detector/os.rb', line 19

def desktop?
  DESKTOP_OSS.include?(family)
end

#familyObject



15
16
17
# File 'lib/device_detector/os.rb', line 15

def family
  os_info[:family]
end

#full_versionObject



23
24
25
26
# File 'lib/device_detector/os.rb', line 23

def full_version
  raw_version = super.to_s.split('_').join('.')
  raw_version == '' ? nil : raw_version
end

#nameObject



7
8
9
# File 'lib/device_detector/os.rb', line 7

def name
  os_info[:name]
end

#short_nameObject



11
12
13
# File 'lib/device_detector/os.rb', line 11

def short_name
  os_info[:short]
end