Class: MorseCode::Encoders::English

Inherits:
Base
  • Object
show all
Defined in:
lib/morse_code/encoders/english.rb

Instance Attribute Summary

Attributes inherited from Base

#word

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize, #supported_class

Constructor Details

This class inherits a constructor from MorseCode::Encoders::Base

Instance Method Details

#encodeObject



12
13
14
# File 'lib/morse_code/encoders/english.rb', line 12

def encode
  MorseCode::ENCODE_MAP[word]
end

#supported?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/morse_code/encoders/english.rb', line 8

def supported?
  !MorseCode::ENCODE_MAP[word].nil?
end