Sha256: ed214ae21691a53fb4f3d90fc3d3ef01ea0d9d1c5ed425730fd2d5c875d69f7c
Contents?: true
Size: 547 Bytes
Versions: 6
Compression:
Stored size: 547 Bytes
Contents
require 'thread' require 'clarion/stores/base' require 'clarion/authn' module Clarion module Stores class Memory < Base def initialize(*) super @lock = Mutex.new @store = {} end def store_authn(authn) @lock.synchronize do @store[authn.id] = authn.to_h(:all) end end def find_authn(id) @lock.synchronize do unless @store.key?(id) return nil end Authn.new(**@store[id]) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems