Sha256: 69dbadf4e752e973ee8949aa895702bff7361aab42699fd76ac6517f8752e29b

Contents?: true

Size: 445 Bytes

Versions: 18

Compression:

Stored size: 445 Bytes

Contents

module Mangadex
  module Storage
    class Memory < BasicObject
      def initialize
        @storage = {}
      end

      def get(scope, key)
        @storage.dig(scope.to_s, key.to_s)
      end

      def set(scope, key, value)
        key = key.to_s
        @storage[scope] = {} unless @storage.has_key?(scope)
        @storage[scope][key] = value
      end

      def clear(scope)
        @storage.delete(scope)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mangadex-5.10.0 lib/mangadex/storage/memory.rb
mangadex-5.9.0 lib/mangadex/storage/memory.rb
mangadex-5.8.0 lib/mangadex/storage/memory.rb
mangadex-5.7.5.3 lib/mangadex/storage/memory.rb
mangadex-5.7.5.2 lib/mangadex/storage/memory.rb
mangadex-5.7.5.1 lib/mangadex/storage/memory.rb
mangadex-5.7.5 lib/mangadex/storage/memory.rb
mangadex-5.5.8 lib/mangadex/storage/memory.rb
mangadex-5.5.6 lib/mangadex/storage/memory.rb
mangadex-5.4.16 lib/mangadex/storage/memory.rb
mangadex-5.4.11.3 lib/mangadex/storage/memory.rb
mangadex-5.4.11.2 lib/mangadex/storage/memory.rb
mangadex-5.4.11.1 lib/mangadex/storage/memory.rb
mangadex-5.4.11 lib/mangadex/storage/memory.rb
mangadex-5.4.9 lib/mangadex/storage/memory.rb
mangadex-5.3.3.4 lib/mangadex/storage/memory.rb
mangadex-5.3.3.3 lib/mangadex/storage/memory.rb
mangadex-5.3.3.2 lib/mangadex/storage/memory.rb