Module: ObfuscatedMorseCode
- Defined in:
- lib/obfuscated_morse_code.rb,
lib/obfuscated_morse_code/version.rb,
lib/obfuscated_morse_code/file_parser.rb,
lib/obfuscated_morse_code/morse_code_obfuscator.rb,
lib/obfuscated_morse_code/morse_code_translator.rb
Defined Under Namespace
Classes: FileParser, MorseCodeObfuscator, MorseCodeTranslator
Constant Summary
collapse
- VERSION =
'0.2.3'
Class Method Summary
collapse
Class Method Details
.morse_code(file_path) ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'lib/obfuscated_morse_code.rb', line 9
def self.morse_code(file_path)
parsed_text = FileParser.new(file_path).parse
MorseCodeTranslator.new.translate(parsed_text).join("\n")
rescue ArgumentError => e
puts e.message
rescue FileParser::FileNotFoundError => e
puts e.message
end
|
.obfuscated_morse_code(file_path) ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/obfuscated_morse_code.rb', line 18
def self.obfuscated_morse_code(file_path)
parsed_text = FileParser.new(file_path).parse
morse_code = MorseCodeTranslator.new.translate(parsed_text)
MorseCodeObfuscator.new(morse_code).obfuscate.join("\n")
rescue ArgumentError => e
puts e.message
rescue FileParser::FileNotFoundError => e
puts e.message
end
|