Class: Browser::Platform::Mac

Inherits:
Base
  • Object
show all
Defined in:
lib/browser/platform/mac.rb

Instance Attribute Summary

Attributes inherited from Base

#accept_language, #ua

Instance Method Summary collapse

Methods inherited from Base

#alipay?, #bot, #bot?, #chrome?, #compatibility_view?, #core_media?, #device, #edge?, #electron?, #facebook?, #firefox?, #ie?, #initialize, #known?, #meta, #micro_messenger?, #modern?, #msie_full_version, #msie_version, #nokia?, #opera?, #opera_mini?, #otter?, #phantom_js?, #platform, #proxy?, #quicktime?, #safari?, #safari_webapp_mode?, #to_s, #uc_browser?, #webkit?, #webkit_full_version, #weibo?, #yandex?

Constructor Details

This class inherits a constructor from Browser::Base

Instance Method Details

#idObject



14
15
16
# File 'lib/browser/platform/mac.rb', line 14

def id
  :mac
end

#match?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/browser/platform/mac.rb', line 18

def match?
  ua =~ /Mac/
end

#nameObject



10
11
12
# File 'lib/browser/platform/mac.rb', line 10

def name
  "Macintosh"
end

#versionObject



6
7
8
# File 'lib/browser/platform/mac.rb', line 6

def version
  (ua[/Mac OS X\s*([0-9_\.]+)?/, 1] || "0").tr("_", ".")
end