class Kayvee::Clients::Memory

An in memory kv store

Public Class Methods

new(options) click to toggle source

@param [Hash] options for the client

# File lib/kayvee/clients/memory.rb, line 8
def initialize(options)
  @options = options
  validate_options!
  @store = {}
end

Public Instance Methods

read(path) click to toggle source

@param [String] path the path to read

@return [Stringnil] the read string or nil if key does not exist

# File lib/kayvee/clients/memory.rb, line 17
def read(path)
  @store[path]
end
write(path, value) click to toggle source

@param [String] path the path to read @param [String] value the value to set

@return [Key] the modified key

# File lib/kayvee/clients/memory.rb, line 25
def write(path, value)
  @store[path] = value
end

Private Instance Methods

validate_options!() click to toggle source
# File lib/kayvee/clients/memory.rb, line 31
def validate_options!
  true
end