Module: Upvote::Configuration
- Included in:
- Upvote
- Defined in:
- lib/upvote/configuration.rb
Instance Method Summary collapse
- #default_id_method ⇒ Object
- #default_id_method=(method) ⇒ Object
- #id_method(klass) ⇒ Object
- #id_methods ⇒ Object
- #redis ⇒ Object
- #redis=(client) ⇒ Object
Instance Method Details
#default_id_method ⇒ Object
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_methods ⇒ Object
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 |
#redis ⇒ Object
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 |