Sha256: 5f46f7837fc2a79422590b5b909c5187126b0548f5297713156decd0aeefba05

Contents?: true

Size: 400 Bytes

Versions: 11

Compression:

Stored size: 400 Bytes

Contents

# encoding: binary
# frozen_string_literal: true

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

11 entries across 11 versions & 1 rubygems

Version Path
rbnacl-7.1.2 lib/rbnacl/serializable.rb
rbnacl-7.1.1 lib/rbnacl/serializable.rb
rbnacl-7.1.0 lib/rbnacl/serializable.rb
rbnacl-7.0.0 lib/rbnacl/serializable.rb
rbnacl-6.0.1 lib/rbnacl/serializable.rb
rbnacl-6.0.0 lib/rbnacl/serializable.rb
rbnacl-5.0.0 lib/rbnacl/serializable.rb
rbnacl-4.0.2 lib/rbnacl/serializable.rb
rbnacl-4.0.1 lib/rbnacl/serializable.rb
rbnacl-4.0.0 lib/rbnacl/serializable.rb
rbnacl-4.0.0.pre lib/rbnacl/serializable.rb