Class: Vail::Command::Sound

Inherits:
Object
  • Object
show all
Defined in:
lib/vail/command/sound.rb

Instance Method Summary collapse

Constructor Details

#initialize(morse) ⇒ Sound

Returns a new instance of Sound.



4
5
6
# File 'lib/vail/command/sound.rb', line 4

def initialize(morse)
  @morse = morse
end

Instance Method Details

#execute(config) ⇒ Object



8
9
10
# File 'lib/vail/command/sound.rb', line 8

def execute(config)
  Beep::Sound.generate(@morse.map { |dotdash| { :duration => config[dotdash]["duration"], :pause => config[dotdash]["pause"], :frequency => config["frequency"] }})
end