Class: Ristretta::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ristretta/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Returns a new instance of Configuration.



8
9
10
11
12
# File 'lib/ristretta/configuration.rb', line 8

def initialize
  @version = "1"
  @namespace = "ristretta"
  @subject_id_method = :id
end

Instance Attribute Details

#namespace ⇒ Object

Returns the value of attribute namespace.



3
4
5
# File 'lib/ristretta/configuration.rb', line 3

def namespace
  @namespace
end

#redis_client ⇒ Object

Returns the value of attribute redis_client.



3
4
5
# File 'lib/ristretta/configuration.rb', line 3

def redis_client
  @redis_client
end

#subject_id_method ⇒ Object

Returns the value of attribute subject_id_method.



3
4
5
# File 'lib/ristretta/configuration.rb', line 3

def subject_id_method
  @subject_id_method
end

#version ⇒ Object

Returns the value of attribute version.



3
4
5
# File 'lib/ristretta/configuration.rb', line 3

def version
  @version
end

Instance Method Details

#client ⇒ Object



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

def client
  @client ||= Redis::Namespace.new(namespace.to_sym, redis: redis_client)
end