Sha256: 06de0f82be87f4300390ca683a226e3d02a878cfeeb6969c1a269ca1328174a5
Contents?: true
Size: 581 Bytes
Versions: 14
Compression:
Stored size: 581 Bytes
Contents
require 'aws-sdk' module Alephant class Cache attr_reader :id, :bucket, :path def initialize(id, path) @logger = ::Alephant.logger @id = id @path = path s3 = AWS::S3.new @bucket = s3.buckets[id] @logger.info("Cache.initialize: end with id #{id} and path #{path}") end def put(id, data) @bucket.objects["#{@path}/#{id}"].write(data) @logger.info("Cache.put: #{@path}/#{id}") end def get(id) @logger.info("Cache.get: #{@path}/#{id}") @bucket.objects["#{@path}/#{id}"].read end end end
Version data entries
14 entries across 14 versions & 1 rubygems