Module: RbNaCl::Serializable

Overview

Serialization features shared across all "key-like" classes

Instance Method Summary collapse

Instance Method Details

#inspectString

Inspect this key

Returns:

  • (String)

    a string representing this key


18
19
20
# File 'lib/rbnacl/serializable.rb', line 18

def inspect
  "#<#{self.class}:#{Util.bin2hex(to_bytes)[0, 8]}>"
end

#to_sObject


7
8
9
# File 'lib/rbnacl/serializable.rb', line 7

def to_s
  to_bytes
end

#to_strObject


11
12
13
# File 'lib/rbnacl/serializable.rb', line 11

def to_str
  to_bytes
end