Module: ActivityFeed::Configuration
- Included in:
- ActivityFeed
- Defined in:
- lib/activity_feed/configuration.rb
Overview
Configuration settings for ActivityFeed.
Instance Attribute Summary collapse
-
#aggregate ⇒ Object
Indicates whether or not aggregation is enabled.
-
#aggregate_key ⇒ Object
Key used in Redis for an individul’s aggregate feed.
-
#item_loader ⇒ Object
Proc that will be called for loading an item from an ORM (e.g. ActiveRecord) or ODM (e.g. Mongoid).
-
#namespace ⇒ Object
ActivityFeed namespace for Redis.
-
#page_size ⇒ Object
Default page size.
-
#redis ⇒ Object
Redis instance.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure ActivityFeed with block-style configuration.
Instance Attribute Details
#aggregate ⇒ Object
Indicates whether or not aggregation is enabled.
47 48 49 |
# File 'lib/activity_feed/configuration.rb', line 47 def aggregate @aggregate ||= false end |
#aggregate_key ⇒ Object
Key used in Redis for an individul’s aggregate feed.
54 55 56 |
# File 'lib/activity_feed/configuration.rb', line 54 def aggregate_key @aggregate_key ||= 'aggregate' end |
#item_loader ⇒ Object
Proc that will be called for loading an item from an ORM (e.g. ActiveRecord) or ODM (e.g. Mongoid). Proc will be called with the ID of the item from the feed.
8 9 10 |
# File 'lib/activity_feed/configuration.rb', line 8 def item_loader @item_loader end |
#namespace ⇒ Object
ActivityFeed namespace for Redis.
40 41 42 |
# File 'lib/activity_feed/configuration.rb', line 40 def namespace @namespace ||= 'activity_feed' end |
#page_size ⇒ Object
Default page size.
61 62 63 |
# File 'lib/activity_feed/configuration.rb', line 61 def page_size @page_size ||= 25 end |
#redis ⇒ Object
Redis instance.
5 6 7 |
# File 'lib/activity_feed/configuration.rb', line 5 def redis @redis end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure ActivityFeed with block-style configuration.
Example:
ActivityFeed.configure do |configuration|
configuration.redis = Redis.new
configuration.namespace = 'activity_feed'
configuration.aggregate = false
configuration.aggregate_key = 'aggregate'
configuration.page_size = 25
end
33 34 35 |
# File 'lib/activity_feed/configuration.rb', line 33 def configure yield self end |