Module: BrowsingHistory::Configuration

Included in:
BrowsingHistory
Defined in:
lib/browsing_history/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#namespaceObject

BrowsingHistory namespace for Redis.

Returns:

  • the BrowsingHistory namespace. default of ‘activity_feed’ if not set.



43
44
45
# File 'lib/browsing_history/configuration.rb', line 43

def namespace
  @namespace ||= 'browsing_history'
end

#storage_typesObject

BrowsingHistory storage_types

Returns:

  • the BrowsingHistory storage. default of :redis if not set.



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

Yields:

  • (_self)

Yield Parameters:



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

def configure
  yield self
end

#storage_typeObject

BrowsingHistory storage

Returns:

  • the BrowsingHistory storage. default of :redis if not set.



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