Class: SoldierOfCode::SpyVsSpy::OS

Inherits:
Object
  • Object
show all
Defined in:
lib/spy_vs_spy.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


84
85
86
# File 'lib/spy_vs_spy.rb', line 84

def linux?
  @exact_os == 'Linux'
end

#osx?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/spy_vs_spy.rb', line 80

def osx?
  @exact_os == 'Mac OS X'
end

#to_sObject



76
77
78
# File 'lib/spy_vs_spy.rb', line 76

def to_s
  @os_string
end

#windows?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/spy_vs_spy.rb', line 88

def windows?
  @exact_os == 'Windows'
end