Module: Moneta::OptionSupport Private
- Included in:
- Defaults
- Defined in:
- lib/moneta/mixins.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#expires(expires) ⇒ OptionMerger
Return Moneta store with default expiration time.
-
#prefix(prefix) ⇒ OptionMerger
Return Moneta store with default prefix option.
-
#raw ⇒ OptionMerger
Return Moneta store with default option :raw => true.
-
#with(options) ⇒ OptionMerger
Return Moneta store with default options.
Instance Method Details
#expires(expires) ⇒ OptionMerger
Return Moneta store with default expiration time
40 41 42 |
# File 'lib/moneta/mixins.rb', line 40 def expires(expires) with(:expires => expires, :only => [:store, :increment]) end |
#prefix(prefix) ⇒ OptionMerger
Return Moneta store with default prefix option
31 32 33 |
# File 'lib/moneta/mixins.rb', line 31 def prefix(prefix) with(:prefix => prefix, :except => :clear) end |
#raw ⇒ OptionMerger
Return Moneta store with default option :raw => true
17 18 19 20 21 22 23 24 |
# File 'lib/moneta/mixins.rb', line 17 def raw @raw_store ||= begin store = with(:raw => true, :only => [:load, :store, :delete]) store.instance_variable_set(:@raw_store, store) store end end |
#with(options) ⇒ OptionMerger
Return Moneta store with default options
9 10 11 |
# File 'lib/moneta/mixins.rb', line 9 def with() OptionMerger.new(self, ) end |