Exception: Hashing::UnconfiguredIvarError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hashing/unconfigured_ivar_error.rb

Overview

Inform the user about an attempt to create an instance, using a ‘Hash` with keys that does not correspond to the mape made using `.hasherize`

Since:

  • 0.0.1

Instance Method Summary collapse

Constructor Details

#initialize(ivar_names, class_name) ⇒ UnconfiguredIvarError

Returns a new instance of UnconfiguredIvarError.

Since:

  • 0.0.1



5
6
7
8
9
10
11
# File 'lib/hashing/unconfigured_ivar_error.rb', line 5

def initialize(ivar_names, class_name)
  super [
    "The hash passed to #{class_name}.from_hash has the following ",
    "keys that aren't configured by the .hasherize method: ",
    "#{ivar_names.join ","}."
  ].join
end