Class: ObfuscatedMorseCode::MorseCodeObfuscator
- Inherits:
-
Object
- Object
- ObfuscatedMorseCode::MorseCodeObfuscator
- Defined in:
- lib/obfuscated_morse_code/morse_code_obfuscator.rb
Constant Summary collapse
- DASH_OBFUSCATION_DICTIONARY =
%w[A B C D E].freeze
Instance Attribute Summary collapse
-
#morse_codes ⇒ Object
readonly
Returns the value of attribute morse_codes.
Instance Method Summary collapse
-
#initialize(morse_codes) ⇒ MorseCodeObfuscator
constructor
A new instance of MorseCodeObfuscator.
- #obfuscate ⇒ Object
Constructor Details
#initialize(morse_codes) ⇒ MorseCodeObfuscator
Returns a new instance of MorseCodeObfuscator.
9 10 11 |
# File 'lib/obfuscated_morse_code/morse_code_obfuscator.rb', line 9 def initialize(morse_codes) @morse_codes = morse_codes end |
Instance Attribute Details
#morse_codes ⇒ Object (readonly)
Returns the value of attribute morse_codes.
7 8 9 |
# File 'lib/obfuscated_morse_code/morse_code_obfuscator.rb', line 7 def morse_codes @morse_codes end |
Instance Method Details
#obfuscate ⇒ Object
13 14 15 16 17 18 |
# File 'lib/obfuscated_morse_code/morse_code_obfuscator.rb', line 13 def obfuscate morse_codes.map do |code| = replace_dots_with_numbers(code) replace_dashes_with_characters() end end |