Files

Class/Module Index [+]

Quicksearch

Moneta::CreateSupport

Implements simple create using key? and store.

This is sufficient for non-shared stores or if atomicity is not required. @api private

Public Class Methods

included(base) click to toggle source
# File lib/moneta/mixins.rb, line 251
def self.included(base)
  base.supports(:create) if base.respond_to?(:supports)
end

Public Instance Methods

create(key, value, options = {}) click to toggle source

(see Defaults#create)

# File lib/moneta/mixins.rb, line 242
def create(key, value, options = {})
  if key? key
    false
  else
    store(key, value, options)
    true
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.