Class: Determinator::Retrieve::RoutemasterFeatureIdCacheWarmer
- Inherits:
-
Object
- Object
- Determinator::Retrieve::RoutemasterFeatureIdCacheWarmer
- Defined in:
- lib/determinator/retrieve/routemaster_feature_id_cache_warmer.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(payload) ⇒ RoutemasterFeatureIdCacheWarmer
constructor
A new instance of RoutemasterFeatureIdCacheWarmer.
Constructor Details
#initialize(payload) ⇒ RoutemasterFeatureIdCacheWarmer
Returns a new instance of RoutemasterFeatureIdCacheWarmer.
4 5 6 |
# File 'lib/determinator/retrieve/routemaster_feature_id_cache_warmer.rb', line 4 def initialize(payload) @payload = payload end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/determinator/retrieve/routemaster_feature_id_cache_warmer.rb', line 8 def call response = client.get(@payload['url']).body if valid_feature_response?(response) key = Routemaster.index_cache_key(response['name']) ::Routemaster::Config.cache_redis.set(key, response['id']) end end |