class Gauge::DataStore

@api public

Public Class Methods

new() click to toggle source

@api private

# File lib/datastore.rb, line 11
def initialize
  clear
end

Public Instance Methods

clear() click to toggle source

@api private

# File lib/datastore.rb, line 30
def clear
  @data_map = Hash.new
end
get(key) click to toggle source

Fetches the object corresponding to the given key @param key [string], the key for retrieving object. @return [object]

# File lib/datastore.rb, line 18
def get(key)
  @data_map[key]
end
put(key, value) click to toggle source

Stores the object against the given key @param key [string], the key for storing the object, has to be unique @param value [object], the object to be persisted

# File lib/datastore.rb, line 25
def put(key, value)
  @data_map[key] = value
end