Class: Spree::Preferences::ScopedStore

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/preferences/scoped_store.rb

Instance Method Summary (collapse)

Constructor Details

- (ScopedStore) initialize(prefix, suffix = nil)

Returns a new instance of ScopedStore



3
4
5
6
# File 'app/models/spree/preferences/scoped_store.rb', line 3

def initialize(prefix, suffix = nil)
  @prefix = prefix
  @suffix = suffix
end

Instance Method Details

- (Object) []=(key, value)



16
17
18
# File 'app/models/spree/preferences/scoped_store.rb', line 16

def []=(key, value)
  store[key_for(key)] = value
end

- (Object) delete(key)



20
21
22
# File 'app/models/spree/preferences/scoped_store.rb', line 20

def delete(key)
  store.delete(key_for(key))
end

- (Object) fetch(key, &block)



12
13
14
# File 'app/models/spree/preferences/scoped_store.rb', line 12

def fetch(key, &block)
  store.fetch(key_for(key), &block)
end

- (Object) store



8
9
10
# File 'app/models/spree/preferences/scoped_store.rb', line 8

def store
  Spree::Preferences::Store.instance
end