Class: OpenWeatherClient::Caching::Redis
- Inherits:
-
OpenWeatherClient::Caching
- Object
- OpenWeatherClient::Caching
- OpenWeatherClient::Caching::Redis
- Defined in:
- lib/open_weather_client-caching-redis/caching/redis.rb,
lib/open_weather_client-caching-redis/caching/redis/version.rb
Overview
Redis cache of OpenWeatherMap requests
The requests are cached in redis with an expiration time set by the configuration
Constant Summary collapse
- VERSION =
'0.1.2'
Instance Attribute Summary collapse
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
Instance Method Summary collapse
-
#initialize ⇒ Redis
constructor
A new instance of Redis.
Constructor Details
#initialize ⇒ Redis
Returns a new instance of Redis.
17 18 19 20 21 22 |
# File 'lib/open_weather_client-caching-redis/caching/redis.rb', line 17 def initialize super config = OpenWeatherClient.configuration @redis = ::Redis.new(host: config.host, port: config.port, db: config.db) end |
Instance Attribute Details
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
15 16 17 |
# File 'lib/open_weather_client-caching-redis/caching/redis.rb', line 15 def redis @redis end |