Sha256: 1e96a49362fa269095afe96a6f8ae2608b1ad2626ea56ef15bf42be82cb27c11

Contents?: true

Size: 369 Bytes

Versions: 3

Compression:

Stored size: 369 Bytes

Contents

# encoding: binary
module RbNaCl
  # Serialization features shared across all "key-like" classes
  module Serializable
    def to_s
      to_bytes
    end

    def to_str
      to_bytes
    end

    # Inspect this key
    #
    # @return [String] a string representing this key
    def inspect
      "#<#{self.class}:#{Util.bin2hex(to_bytes)[0, 8]}>"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rbnacl-3.4.0 lib/rbnacl/serializable.rb
rbnacl-3.3.0 lib/rbnacl/serializable.rb
rbnacl-3.2.0 lib/rbnacl/serializable.rb