Sha256: ec1ef52527074934dc24803da38cb0288f7383338d89b665af0b3ee04dc05e4c

Contents?: true

Size: 458 Bytes

Versions: 5

Compression:

Stored size: 458 Bytes

Contents

module Scrooge
  module Storage
    class Memory < Base
      
      attr_reader :storage
      
      def initialize
        @storage = {}
      end
      
      def read( tracker )
        GUARD.synchronize do
          @storage[tracker.signature]
        end
      end
                  
      def write( tracker, buffered = true )
        GUARD.synchronize do
          @storage[tracker.signature] = tracker
        end
      end
      
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
methodmissing-scrooge-1.0.0 lib/scrooge/storage/memory.rb
methodmissing-scrooge-1.0.1 lib/scrooge/storage/memory.rb
methodmissing-scrooge-1.0.2 lib/scrooge/storage/memory.rb
methodmissing-scrooge-1.0.3 lib/scrooge/storage/memory.rb
methodmissing-scrooge-1.0.4 lib/scrooge/storage/memory.rb