Module: BrowsingHistory::Configuration
- Included in:
- BrowsingHistory
- Defined in:
- lib/browsing_history/configuration.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
BrowsingHistory namespace for Redis.
-
#storage_types ⇒ Object
BrowsingHistory storage_types.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
cofigure method.
-
#storage_type ⇒ Object
BrowsingHistory storage.
- #storage_type=(type) ⇒ Object
Instance Attribute Details
#namespace ⇒ Object
BrowsingHistory namespace for Redis.
35 36 37 |
# File 'lib/browsing_history/configuration.rb', line 35 def namespace @namespace ||= 'browsing_history' end |
#storage_types ⇒ Object
BrowsingHistory storage_types
16 17 18 |
# File 'lib/browsing_history/configuration.rb', line 16 def storage_types @storage_types ||= %i(redis active_record) end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
cofigure method
9 10 11 |
# File 'lib/browsing_history/configuration.rb', line 9 def configure yield self end |
#storage_type ⇒ Object
BrowsingHistory storage
23 24 25 |
# File 'lib/browsing_history/configuration.rb', line 23 def storage_type @storage_type ||= storage_types.first end |
#storage_type=(type) ⇒ Object
27 28 29 30 |
# File 'lib/browsing_history/configuration.rb', line 27 def storage_type=(type) return false unless storage_types.incude?(type) @storage_type = type end |