Parent

Files

Class/Module Index [+]

Quicksearch

Moneta::Adapters::Daybreak

Daybreak backend @api public

Public Class Methods

new(options = {}) click to toggle source

@param [Hash] options @option options [String] :file Database file @option options [::Daybreak] :backend Use existing backend instance

# File lib/moneta/adapters/daybreak.rb, line 11
def initialize(options = {})
  @backend = options[:backend] ||
    begin
      raise ArgumentError, 'Option :file is required' unless options[:file]
      ::Daybreak::DB.new(options[:file], :serializer => ::Daybreak::Serializer::None)
    end
end

Public Instance Methods

close() click to toggle source

(see Proxy#close)

# File lib/moneta/adapters/daybreak.rb, line 43
def close
  @backend.close
end
create(key, value, options = {}) click to toggle source

(see Proxy#create)

# File lib/moneta/adapters/daybreak.rb, line 38
def create(key, value, options = {})
  @backend.lock { super }
end
increment(key, amount = 1, options = {}) click to toggle source

(see Proxy#increment)

# File lib/moneta/adapters/daybreak.rb, line 33
def increment(key, amount = 1, options = {})
  @backend.lock { super }
end
load(key, options = {}) click to toggle source

(see Proxy#load)

# File lib/moneta/adapters/daybreak.rb, line 20
def load(key, options = {})
  @backend.load if options[:sync]
  @backend[key]
end
store(key, value, options = {}) click to toggle source

(see Proxy#store)

# File lib/moneta/adapters/daybreak.rb, line 26
def store(key, value, options = {})
  @backend[key] = value
  @backend.flush if options[:sync]
  value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.