Class: MorseCode::Cli
- Inherits:
-
Thor
- Object
- Thor
- MorseCode::Cli
- Defined in:
- lib/morse_code/cli.rb
Instance Method Summary collapse
Instance Method Details
#decode(message = '') ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/morse_code/cli.rb', line 29 def decode( = '') if [:dit_dah] puts MorseCode::Decoder.new().dit_dah_to else puts MorseCode::Decoder.new().decode end end |
#encode(message = '') ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/morse_code/cli.rb', line 14 def encode( = '') encoder = MorseCode::Encoder.new() if [:dit_dah] puts encoder.dit_dah else puts encoder.encode end if [:wave] wavefile = encoder.wave puts "Generate wave file: #{wavefile}" end end |