module LittleWeasel::Modules::DictionaryKeyValidatable

Provides methods to validate a dictionary key object.

Public Class Methods

validate(dictionary_key:) click to toggle source
# File lib/LittleWeasel/modules/dictionary_key_validatable.rb, line 9
def self.validate(dictionary_key:)
  raise ArgumentError, "Argument dictionary_key is not a valid DictionaryKey object: #{dictionary_key.class}" \
    unless dictionary_key.is_a? DictionaryKey
end

Public Instance Methods

validate_dictionary_key(dictionary_key:) click to toggle source
# File lib/LittleWeasel/modules/dictionary_key_validatable.rb, line 14
def validate_dictionary_key(dictionary_key:)
  DictionaryKeyValidatable.validate(dictionary_key: dictionary_key)
end