Class: MorseCode::Encoders::English

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

Instance Attribute Summary

Attributes inherited from Base

#namespace, #word

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize, #supported_class, #supported_classes

Constructor Details

This class inherits a constructor from MorseCode::Base

Instance Method Details

#callObject



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

def call
  MorseCode::ENCODE_MAP[word]
end

#supported?Boolean

Returns:

  • (Boolean)


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

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