@private
# File lib/aws/core/response_cache.rb, line 24 def initialize @cached_responses = [] @indexed_responses = {} @resource_cache = ResourceCache.new end
# File lib/aws/core/response_cache.rb, line 30 def add(resp) cached_responses.unshift(resp) @indexed_responses[resp.cache_key] = resp if resp.respond_to?(:cache_key) @resource_cache = ResourceCache.new end
# File lib/aws/core/response_cache.rb, line 44 def cached(resp) @indexed_responses[resp.cache_key] end
# File lib/aws/core/response_cache.rb, line 37 def select(*types, &block) cached_responses.select do |resp| types.map{|t| t.to_s }.include?(resp.request_type.to_s) and (block.nil? || block.call(resp)) end end