Class: Death::Voice

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ressure_factor = 3) ⇒ Voice

Returns a new instance of Voice.



12
13
14
# File 'lib/death/voice.rb', line 12

def initialize(ressure_factor = 3)
  @ressure_factor = ressure_factor
end

Class Method Details

.say(message) ⇒ Object



7
8
9
# File 'lib/death/voice.rb', line 7

def say(message)
  new.say(message)
end

Instance Method Details

#say(message) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/death/voice.rb', line 16

def say(message)
  raise 'death command is supporting only Mac OS X.' unless supported_os?

  fork do
    sound_pressure { spawn("say -v Ralph #{Shellwords.shellescape(message)}") }
  end
end