Module: Upvote::Configuration

Included in:
Upvote
Defined in:
lib/upvote/configuration.rb

Instance Method Summary collapse

Instance Method Details

#default_id_methodObject



24
25
26
# File 'lib/upvote/configuration.rb', line 24

def default_id_method
  @id_method ||= :id
end

#default_id_method=(method) ⇒ Object



20
21
22
# File 'lib/upvote/configuration.rb', line 20

def default_id_method=(method)
  @id_method = method
end

#id_method(klass) ⇒ Object



12
13
14
# File 'lib/upvote/configuration.rb', line 12

def id_method(klass)
  id_methods[klass]
end

#id_methodsObject



16
17
18
# File 'lib/upvote/configuration.rb', line 16

def id_methods
  @id_methods ||= Hash.new { |h, k| h[k] = default_id_method }
end

#redisObject



8
9
10
# File 'lib/upvote/configuration.rb', line 8

def redis
  @client ||= Redis.new
end

#redis=(client) ⇒ Object



4
5
6
# File 'lib/upvote/configuration.rb', line 4

def redis=(client)
  @client = client
end