Object
Moneta client backend @api public
@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
(see Proxy#clear)
# File lib/moneta/adapters/client.rb, line 57 def clear(options = {}) write(:clear, options) read self end
(see Proxy#close)
# File lib/moneta/adapters/client.rb, line 64 def close @socket.close nil end
(see Proxy#create)
# File lib/moneta/adapters/client.rb, line 51 def create(key, value, options = {}) write(:create, key, value, options) read end
(see Proxy#delete)
# File lib/moneta/adapters/client.rb, line 39 def delete(key, options = {}) write(:delete, key, options) read end
(see Default#features)
# File lib/moneta/adapters/client.rb, line 70 def features @features ||= begin write(:features) read.freeze end end
(see Proxy#increment)
# File lib/moneta/adapters/client.rb, line 45 def increment(key, amount = 1, options = {}) write(:increment, key, amount, options) read end
(see Proxy#key?)
# File lib/moneta/adapters/client.rb, line 20 def key?(key, options = {}) write(:key?, key, options) read end
(see Proxy#load)
# File lib/moneta/adapters/client.rb, line 26 def load(key, options = {}) write(:load, key, options) read end
(see Proxy#store)
# File lib/moneta/adapters/client.rb, line 32 def store(key, value, options = {}) write(:store, key, value, options) read value end
Generated with the Darkfish Rdoc Generator 2.