Module: LittleWeasel::Modules::DictionaryCacheValidatable

Included in:
DictionaryCacheServicable, DictionaryMetadataServicable, Services::DictionaryCacheService
Defined in:
lib/LittleWeasel/modules/dictionary_cache_validatable.rb

Overview

This module provides methods to validate a dictionary cache object. A dictionary cache object is a container that holds cached data related to one or more dictionaries. Dictionary cache objects are normally specific to a DictionaryManager object.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.validate_dictionary_cache(dictionary_cache:) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
# File 'lib/LittleWeasel/modules/dictionary_cache_validatable.rb', line 12

def validate_dictionary_cache(dictionary_cache:)
  raise ArgumentError, "Argument dictionary_cache is not a valid Hash object: #{dictionary_cache.class}" \
    unless dictionary_cache.is_a? Hash
end

Instance Method Details

#validate_dictionary_cache(dictionary_cache:) ⇒ Object (private)



12
13
14
15
# File 'lib/LittleWeasel/modules/dictionary_cache_validatable.rb', line 12

def validate_dictionary_cache(dictionary_cache:)
  raise ArgumentError, "Argument dictionary_cache is not a valid Hash object: #{dictionary_cache.class}" \
    unless dictionary_cache.is_a? Hash
end