Module: Volt::LocalStorage
- Defined in:
- lib/volt/utils/local_storage.rb,
lib/volt/utils/local_storage.rb
Constant Summary collapse
- @@store =
{}
Class Method Summary collapse
Class Method Details
.[](key) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/volt/utils/local_storage.rb', line 4 def self.[](key) ` var val = localStorage.getItem(key); return val === null ? nil : val; ` end |
.[]=(key, value) ⇒ Object
11 12 13 |
# File 'lib/volt/utils/local_storage.rb', line 11 def self.[]=(key, value) `localStorage.setItem(key, value)` end |
.clear ⇒ Object
15 16 17 18 |
# File 'lib/volt/utils/local_storage.rb', line 15 def self.clear `localStorage.clear()` self end |
.delete(key) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/volt/utils/local_storage.rb', line 20 def self.delete(key) ` var val = localStorage.getItem(key); localStorage.removeItem(key); return val === null ? nil : val; ` end |