class LittleWeasel::Services::DictionaryKillerService

This service removes a dictionary (Dictionary object) associated with the dictionary key from the dictionary cache along with the dictionary file reference and any metadata associated with the dictionary from the dictionary cache.

Public Class Methods

new(dictionary_key:, dictionary_cache:, dictionary_metadata:) click to toggle source
# File lib/LittleWeasel/services/dictionary_killer_service.rb, line 18
def initialize(dictionary_key:, dictionary_cache:, dictionary_metadata:)
  validate_dictionary_key dictionary_key: dictionary_key
  self.dictionary_key = dictionary_key

  validate_dictionary_cache dictionary_cache: dictionary_cache
  self.dictionary_cache = dictionary_cache

  validate_dictionary_metadata dictionary_metadata: dictionary_metadata
  self.dictionary_metadata = dictionary_metadata
end

Public Instance Methods

execute() click to toggle source
# File lib/LittleWeasel/services/dictionary_killer_service.rb, line 29
def execute
  dictionary_cache_service.init
  dictionary_metadata_service.class.init dictionary_metadata: dictionary_metadata
end