Class: Slideck::InvalidMetadataKeyError

Inherits:
Error
  • Object
show all
Defined in:
lib/slideck/errors.rb

Overview

Raised when metadata key is invalid

Constant Summary collapse

MESSAGE =
"unknown '%<keys>s' configuration %<name>s\n" \
"Available keys are: %<meta_keys>s"

Instance Method Summary collapse

Constructor Details

#initialize(metadata_keys, keys) ⇒ InvalidMetadataKeyError

Create an InvalidMetadataKeyError instance

Examples:

 = %i[align footer pager]
Slideck::InvalidMetadataKeyError.new(, %i[invalid])

Parameters:

  • metadata_keys (Array<Symbol>)

    the allowed metadata keys

  • keys (Array<String>)

    the invalid metadata keys



38
39
40
41
42
43
# File 'lib/slideck/errors.rb', line 38

def initialize(, keys)
  super(format(MESSAGE,
               keys: keys.join(", "),
               name: pluralize("key", keys.size),
               meta_keys: .map(&:inspect).join(", ")))
end