Module: HTTParty::Cache::ClassMethods
- Defined in:
- lib/httparty/cache.rb
Instance Method Summary collapse
-
#cache_control(cache_control) ⇒ Object
Sets cache_control.
-
#cache_store(cache_store = nil) ⇒ HTTParty::Cache::Store::Abstract
This is both a setter and a getter…
-
#caching(caching) ⇒ Bool
Toggle caching.
Instance Method Details
#cache_control(cache_control) ⇒ Object
Sets cache_control
41 42 43 |
# File 'lib/httparty/cache.rb', line 41 def cache_control(cache_control) [:cache_control] = cache_control end |
#cache_store(cache_store = nil) ⇒ HTTParty::Cache::Store::Abstract
This is both a setter and a getter…
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/httparty/cache.rb', line 18 def cache_store(cache_store = nil) case cache_store when NilClass return [:cache_store] when Symbol require_relative "cache/store/#{cache_store}" class_name = cache_store.to_s.split('_').map(&:capitalize).join cache_store = Object.const_get("HTTParty::Cache::Store::#{class_name}").new end [:cache_store] = cache_store end |
#caching(caching) ⇒ Bool
Toggle caching
36 37 38 |
# File 'lib/httparty/cache.rb', line 36 def caching(caching) [:caching] = caching end |