Module: Ristretta

Defined in:
lib/ristretta.rb,
lib/ristretta/event.rb,
lib/ristretta/version.rb,
lib/ristretta/exceptions.rb,
lib/ristretta/configuration.rb

Defined Under Namespace

Modules: Exceptions Classes: Configuration, Event

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.clear_all_events!Object



27
28
29
30
31
# File 'lib/ristretta.rb', line 27

def self.clear_all_events!
  client.smembers("events:keys").each do |key|
    client.del key
  end
end

.clientObject



17
18
19
# File 'lib/ristretta.rb', line 17

def self.client
  configuration.client
end

.config {|configuration| ... } ⇒ Object

Yields:

  • (configuration)


13
14
15
# File 'lib/ristretta.rb', line 13

def self.config(&block)
  yield(configuration)
end

.event_key(options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/ristretta.rb', line 21

def self.event_key(options = {})
  key = "events:v#{configuration.version.to_s}:#{options[:event_subject].send(configuration.subject_id_method)}:#{options[:event_type]}"
  save_key_name(key)
  key
end