module EacRubyUtils::SimpleCache

def call_method_with_cache(method, args, &block)

def call_method_with_cache(method, args, &block)
  raise 'Não é possível realizar o cache de métodos com bloco' if block
  key = ([method] + args).join('@@@')
  unless cache_keys.key?(sanitize_cache_key(key))
    uncached_value = call_uncached_method(method, args)
    cache_keys[sanitize_cache_key(key)] = uncached_value
  end
  cache_keys[sanitize_cache_key(key)]
end