Skip to content

Commit

Permalink
Update morse_decoder.rb to fix rubcop linter error.
Browse files Browse the repository at this point in the history
  • Loading branch information
MussieTeka committed Jun 15, 2023
1 parent 2fc5373 commit f1b3ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions morse_decoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def decode_char(morse_char)

def decode_word(morse_word)
decoded_word = ''
morse_chars = morse_word.split(' ')
morse_chars = morse_word.split

morse_chars.each do |morse_char|
decoded_word += decode_char(morse_char)
Expand All @@ -29,7 +29,7 @@ def decode(message)

morse_words.each do |morse_word|
decoded_word = decode_word(morse_word)
decoded_message += decoded_word + ' ' unless decoded_word.empty?
decoded_message += "#{decoded_word} " unless decoded_word.empty?
end

decoded_message.rstrip
Expand Down

0 comments on commit f1b3ce6

Please sign in to comment.