module Authentication::Storage
Public Instance Methods
current()
click to toggle source
# File lib/authentication/storage.rb, line 32 def current new id: store&.[](store_key) end
current=(v)
click to toggle source
# File lib/authentication/storage.rb, line 36 def current=(v) store&.[]=(store_key, v&.id) end
destroy()
click to toggle source
# File lib/authentication/storage.rb, line 15 def destroy self.class.current = nil end
persisted?()
click to toggle source
# File lib/authentication/storage.rb, line 19 def persisted? self.class.current == self end
save()
click to toggle source
# File lib/authentication/storage.rb, line 6 def save if validate self.class.current = self return true else return false end end
store()
click to toggle source
# File lib/authentication/storage.rb, line 28 def store @store.present? ? @store : (self == Authentication::Base ? nil : Authentication::Base.store) end
store_key()
click to toggle source
# File lib/authentication/storage.rb, line 42 def store_key :"#{to_s.underscore.gsub '/', '_'}_#{id_attribute}" end