Sha256: b63f3e127656a0b675ca6a5a59f4a6a930b94ce8f0983925506c2a020bebda02
Contents?: true
Size: 688 Bytes
Versions: 2
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true require_relative '../idempotency' class Idempotency module Rails def use_cache(request_identifiers = [], lock_duration: nil) response_status, response_headers, response_body = Idempotency.use_cache( request, request_identifiers, lock_duration: ) do yield [response.status, response.headers, response.body] end set_response(response_status, response_headers, response_body) end private def set_response(status, headers, body) response.status = status response.body = body headers.each do |key, value| response.set_header(key, value) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
idempotency-0.1.3 | lib/idempotency/rails.rb |
idempotency-0.1.2 | lib/idempotency/rails.rb |