Class: Bs62

Inherits:
Object
  • Object
show all
Defined in:
lib/bs62.rb,
lib/bs62/version.rb

Constant Summary collapse

VERSION =
"0.1.5"

Class Method Summary collapse

Class Method Details

.decode(str) ⇒ Object

Raises:

  • (TypeError)


23
24
25
26
27
# File 'lib/bs62.rb', line 23

def decode(str)
  raise TypeError, "argument must be a String; got a #{str.class}!" unless str.is_a?(String)

  Bs62.perform_decode(str)
end

.encode(bytes) ⇒ Object

Raises:

  • (TypeError)


17
18
19
20
21
# File 'lib/bs62.rb', line 17

def encode(bytes)
  raise TypeError, "argument must be an array of bytes; got a #{bytes.class}!" unless bytes.is_a?(Array)

  Bs62.perform_encode(bytes)
end