Sha256: 44c3864b1f2e3e102c7c635b115a8572ed3e7631dcb78726612fd16aebf69e67

Contents?: true

Size: 804 Bytes

Versions: 2

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

# Defines an error which is thrown when
# the user attempts to use an algorithm which is not defined.
#
# If the algorithm you want isn't implemented,
# please create an issue on GitHub.
# I can add the library that implements it as an optional dependency.
class UnknownAlgorithmError < StandardError
  def initialize(algorithm = "~")
    super("Attempted to hash with unknown algorithm (got #{algorithm})")
  end
end

# Defines an error which is thrown when
# the user attempts to use an algorithm which is not defined.
#
# If the type you want is standard in Ruby, and doesn't have an encoder yet,
# please create an issue on GitHub.
class NoEncoderError < StandardError
  def initialize(type = "~")
    super("Attempted to encode unknown class (got #{type})")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
object_hash_rb-0.1.3 lib/object_hash_rb/error.rb
object_hash_rb-0.1.2 lib/object_hash_rb/error.rb