Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Moneta::Adapters::Client

Moneta client backend @api public

Public Class Methods

new(options = {}) click to toggle source

@param [Hash] options @option options [Integer] :port (9000) TCP port @option options [String] :host ('127.0.0.1') Hostname @option options [String] :socket Unix socket file name as alternative to `:port` and `:host`

# File lib/moneta/adapters/client.rb, line 14
def initialize(options = {})
  @socket = options[:socket] ? UNIXSocket.open(options[:socket]) :
    TCPSocket.open(options[:host] || '127.0.0.1', options[:port] || 9000)
end

Public Instance Methods

clear(options = {}) click to toggle source

(see Proxy#clear)

# File lib/moneta/adapters/client.rb, line 57
def clear(options = {})
  write(:clear, options)
  read
  self
end
close() click to toggle source

(see Proxy#close)

# File lib/moneta/adapters/client.rb, line 64
def close
  @socket.close
  nil
end
create(key, value, options = {}) click to toggle source

(see Proxy#create)

# File lib/moneta/adapters/client.rb, line 51
def create(key, value, options = {})
  write(:create, key, value, options)
  read
end
delete(key, options = {}) click to toggle source

(see Proxy#delete)

# File lib/moneta/adapters/client.rb, line 39
def delete(key, options = {})
  write(:delete, key, options)
  read
end
features() click to toggle source

(see Default#features)

# File lib/moneta/adapters/client.rb, line 70
def features
  @features ||=
    begin
      write(:features)
      read.freeze
    end
end
increment(key, amount = 1, options = {}) click to toggle source

(see Proxy#increment)

# File lib/moneta/adapters/client.rb, line 45
def increment(key, amount = 1, options = {})
  write(:increment, key, amount, options)
  read
end
key?(key, options = {}) click to toggle source

(see Proxy#key?)

# File lib/moneta/adapters/client.rb, line 20
def key?(key, options = {})
  write(:key?, key, options)
  read
end
load(key, options = {}) click to toggle source

(see Proxy#load)

# File lib/moneta/adapters/client.rb, line 26
def load(key, options = {})
  write(:load, key, options)
  read
end
store(key, value, options = {}) click to toggle source

(see Proxy#store)

# File lib/moneta/adapters/client.rb, line 32
def store(key, value, options = {})
  write(:store, key, value, options)
  read
  value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.