Module: QAT::Web::Elements::Config

Included in:
Base, Waiters
Defined in:
lib/qat/web/elements/config.rb

Overview

Configuration handling helper

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#valid_config?(config, collection) ⇒ Boolean

Validates that the given config is in the correct format

Parameters:

  • config (Hash)

    configuration hash

  • collection (String)

    collection name

Returns:

  • (Boolean)

Since:

  • 1.0.0



10
11
12
13
14
15
# File 'lib/qat/web/elements/config.rb', line 10

def valid_config?(config, collection)
  unless config.kind_of?(Hash) && config.any?
    raise(ArgumentError, "Empty or invalid configuration was given for #{collection.capitalize}! A hash like configuration is expected!")
  end
  true
end