class Hawkei::Store
Hawkei
Store¶ ↑
Store
environment data
Public Class Methods
bulk_set(attributes = {})
click to toggle source
# File lib/hawkei/store.rb, line 33 def bulk_set(attributes = {}) attributes.each do |(key, value)| set(key, value) end end
clear!()
click to toggle source
# File lib/hawkei/store.rb, line 14 def clear! Thread.current[:request_store] = {} end
delete(key, &block)
click to toggle source
# File lib/hawkei/store.rb, line 43 def delete(key, &block) store.delete(key, &block) end
exist?(key)
click to toggle source
# File lib/hawkei/store.rb, line 39 def exist?(key) store.key?(key) end
get(key)
click to toggle source
# File lib/hawkei/store.rb, line 23 def get(key) store[key] end
Also aliased as: []
load_from_hash(object = {})
click to toggle source
# File lib/hawkei/store.rb, line 18 def load_from_hash(object = {}) clear! bulk_set(Util.deep_symbolize_key(object)) if object.is_a?(Hash) end
set(key, value)
click to toggle source
# File lib/hawkei/store.rb, line 28 def set(key, value) store[key] = value end
Also aliased as: []=
store()
click to toggle source
# File lib/hawkei/store.rb, line 10 def store Thread.current[:request_store] ||= {} end