Method: Prawn.verify_options

Defined in:
lib/prawn.rb

.verify_options(accepted, actual) { ... } ⇒ void

This method returns an undefined value.

Parameters:

  • accepted (Array<Symbol>)

    list of valid options

  • actual (Hash<Symbol, any>)

    opetions hash to validate

Yields:

Raises:



50
51
52
53
54
55
56
57
58
# File 'lib/prawn.rb', line 50

def verify_options(accepted, actual)
  return unless debug || $DEBUG

  unless (act = Set[*actual.keys]).subset?(acc = Set[*accepted])
    raise Prawn::Errors::UnknownOption,
      "\nDetected unknown option(s): #{(act - acc).to_a.inspect}\nAccepted options are: #{accepted.inspect}"
  end
  yield if block_given?
end