Sha256: 253eabf1d6f1fc146403e8b14535b867ca1c6e95581526e72c5b097aa7395ddf
Contents?: true
Size: 727 Bytes
Versions: 7
Compression:
Stored size: 727 Bytes
Contents
module Determinator module Retrieve class RoutemasterFeatureIdCacheWarmer def initialize(payload) @payload = payload end 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 private def client @client ||= ::Routemaster::APIClient.new( response_class: ::Routemaster::Responses::HateoasResponse ) end def valid_feature_response?(response) response['id'] && response['name'] && response['bucket_type'] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems