Class: SoldierOfCode::SpyVsSpy::OS
- Inherits:
-
Object
- Object
- SoldierOfCode::SpyVsSpy::OS
- Defined in:
- lib/spy_vs_spy.rb
Instance Method Summary collapse
-
#initialize(os_string) ⇒ OS
constructor
A new instance of OS.
- #linux? ⇒ Boolean
- #osx? ⇒ Boolean
- #to_s ⇒ Object
- #windows? ⇒ Boolean
Constructor Details
#initialize(os_string) ⇒ OS
Returns a new instance of OS.
71 72 73 74 |
# File 'lib/spy_vs_spy.rb', line 71 def initialize(os_string) @os_string = os_string @exact_os = (match = /(Mac OS X|Linux|Windows)/.match(@os_string)) ? match[1] : nil end |
Instance Method Details
#linux? ⇒ Boolean
84 85 86 |
# File 'lib/spy_vs_spy.rb', line 84 def linux? @exact_os == 'Linux' end |
#osx? ⇒ Boolean
80 81 82 |
# File 'lib/spy_vs_spy.rb', line 80 def osx? @exact_os == 'Mac OS X' end |
#to_s ⇒ Object
76 77 78 |
# File 'lib/spy_vs_spy.rb', line 76 def to_s @os_string end |
#windows? ⇒ Boolean
88 89 90 |
# File 'lib/spy_vs_spy.rb', line 88 def windows? @exact_os == 'Windows' end |