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.
43 44 45 |
# File 'lib/browsing_history/configuration.rb', line 43 def namespace @namespace ||= 'browsing_history' end |
#storage_types ⇒ Object
BrowsingHistory storage_types
19 20 21 |
# File 'lib/browsing_history/configuration.rb', line 19 def storage_types @storage_types ||= %i(redis active_record) end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
cofigure method
12 13 14 |
# File 'lib/browsing_history/configuration.rb', line 12 def configure yield self end |
#storage_type ⇒ Object
BrowsingHistory storage
31 32 33 |
# File 'lib/browsing_history/configuration.rb', line 31 def storage_type @storage_type ||= storage_types.first end |
#storage_type=(type) ⇒ Object
35 36 37 38 |
# File 'lib/browsing_history/configuration.rb', line 35 def storage_type=(type) raise BrowsingHistory::InvalidStorageType unless storage_types.include?(type) @storage_type = type end |