Module: CacheBar
- Defined in:
- lib/cachebar.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Class Method Details
.register_api_to_cache(host, options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cachebar.rb', line 18 def self.register_api_to_cache(host, ) raise ArgumentError, "You must provide a host that you are caching API responses for." if host.blank? = ([:expire_in, :key_name] - .keys) if .present? raise(ArgumentError, "Missing some required options: #{missing_options.join(", ")}") end HTTParty::HTTPCache.apis[host] = end |