Class: Cryptogram::Ciphers::BaseCipher

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptogram/ciphers/base_cipher.rb

Direct Known Subclasses

Caesar

Instance Method Summary collapse

Constructor Details

#initialize(alphabet:) ⇒ BaseCipher

Returns a new instance of BaseCipher.

Parameters:

  • alphabet (Array, Symbol)

    Array of chars or presetted alphabet name



8
9
10
# File 'lib/cryptogram/ciphers/base_cipher.rb', line 8

def initialize(alphabet:)
  @alphabet = initialize_alphabet(alphabet)
end

Instance Method Details

#decryptObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/cryptogram/ciphers/base_cipher.rb', line 16

def decrypt
  raise NotImplementedError
end

#encryptObject

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/cryptogram/ciphers/base_cipher.rb', line 12

def encrypt
  raise NotImplementedError
end