class OnesnooperServer::Store

Base class for all backend data stores. Implements key method stubs required for all specific backend data store implementations.

Public Class Methods

new(params = {}) click to toggle source

Initializes data store instance with given parameters.

@param params [Hash] hash-like structure with parameters

# File lib/onesnooper_server/store.rb, line 9
def initialize(params = {})
  @params = params
end

Public Instance Methods

save!(timestamp, data) click to toggle source

Saves given data set into the underlying data store. Behavior is determined by the underlying data store implementation.

@param timestamp [DateTime] current time @param data [Hash] data to be saved in the data store

# File lib/onesnooper_server/store.rb, line 19
def save!(timestamp, data)
  fail "This method needs to be implemented in subclasses"
end