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.
-
#items_loader ⇒ Object
Proc that will be called for loading items 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.
50 51 52 |
# File 'lib/activity_feed/configuration.rb', line 50 def aggregate @aggregate ||= false end |
#aggregate_key ⇒ Object
Key used in Redis for an individul’s aggregate feed.
57 58 59 |
# File 'lib/activity_feed/configuration.rb', line 57 def aggregate_key @aggregate_key ||= 'aggregate' end |
#items_loader ⇒ Object
Proc that will be called for loading items from an ORM (e.g. ActiveRecord) or ODM (e.g. Mongoid). Proc will be called with the IDs of the items from the feed.
10 11 12 |
# File 'lib/activity_feed/configuration.rb', line 10 def items_loader @items_loader end |
#namespace ⇒ Object
ActivityFeed namespace for Redis.
43 44 45 |
# File 'lib/activity_feed/configuration.rb', line 43 def namespace @namespace ||= 'activity_feed' end |
#page_size ⇒ Object
Default page size.
64 65 66 |
# File 'lib/activity_feed/configuration.rb', line 64 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
36 37 38 |
# File 'lib/activity_feed/configuration.rb', line 36 def configure yield self end |