Class: Vail::Command::Sound
- Inherits:
-
Object
- Object
- Vail::Command::Sound
- Defined in:
- lib/vail/command/sound.rb
Instance Method Summary collapse
- #execute(config) ⇒ Object
-
#initialize(morse) ⇒ Sound
constructor
A new instance of Sound.
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 |