Class: ET::OperatingSystem
- Inherits:
-
Object
- Object
- ET::OperatingSystem
- Defined in:
- lib/et/operating_system.rb
Instance Attribute Summary collapse
-
#raw_name ⇒ Object
readonly
Returns the value of attribute raw_name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(os = nil, version = nil) ⇒ OperatingSystem
constructor
A new instance of OperatingSystem.
-
#name ⇒ Object
cribbed from Selenium.
- #platform_family?(platform) ⇒ Boolean
Constructor Details
#initialize(os = nil, version = nil) ⇒ OperatingSystem
Returns a new instance of OperatingSystem.
7 8 9 10 11 12 |
# File 'lib/et/operating_system.rb', line 7 def initialize(os = nil, version = nil) @raw_name, @version = os, version if @raw_name.nil? derive_raw_name end end |
Instance Attribute Details
#raw_name ⇒ Object (readonly)
Returns the value of attribute raw_name.
5 6 7 |
# File 'lib/et/operating_system.rb', line 5 def raw_name @raw_name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
5 6 7 |
# File 'lib/et/operating_system.rb', line 5 def version @version end |
Instance Method Details
#name ⇒ Object
cribbed from Selenium
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/et/operating_system.rb', line 15 def name case @raw_name when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ :windows when /darwin|mac os/ :mac when /linux/ :linux when /solaris|bsd/ :unix end end |
#platform_family?(platform) ⇒ Boolean
28 29 30 |
# File 'lib/et/operating_system.rb', line 28 def platform_family?(platform) name == platform.to_sym end |