Sha256: b9f6fecc0ef13d5f459526775659153394ab37c0ab649d3a1b8ac902d1f9996f

Contents?: true

Size: 335 Bytes

Versions: 18

Compression:

Stored size: 335 Bytes

Contents

module Slosilo
  module Adapters
    class MockAdapter < Hash
      def initialize
        @fp = {}
      end

      def put_key id, key
        @fp[key.fingerprint] = id
        self[id] = key
      end

      alias :get_key :[]

      def get_by_fingerprint fp
        id = @fp[fp]
        [self[id], id]
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
slosilo-3.0.2.pre.224 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.2.pre.5 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.2.pre.44 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.2.pre.42 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.2.pre.2 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.2.pre.35 lib/slosilo/adapters/mock_adapter.rb
slosilo-0.0.0 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.1 lib/slosilo/adapters/mock_adapter.rb
slosilo-3.0.0 lib/slosilo/adapters/mock_adapter.rb
slosilo-2.2.2 lib/slosilo/adapters/mock_adapter.rb
slosilo-2.2.1 lib/slosilo/adapters/mock_adapter.rb
slosilo-2.1.1 lib/slosilo/adapters/mock_adapter.rb
slosilo-2.0.1 lib/slosilo/adapters/mock_adapter.rb
slosilo-2.0.0 lib/slosilo/adapters/mock_adapter.rb
slosilo-1.1.0 lib/slosilo/adapters/mock_adapter.rb
slosilo-1.0.0 lib/slosilo/adapters/mock_adapter.rb
slosilo-0.4.1 lib/slosilo/adapters/mock_adapter.rb
slosilo-0.4.0 lib/slosilo/adapters/mock_adapter.rb