module ActivityFeed::Configuration

Configuration settings for ActivityFeed.

Attributes

aggregate[W]

Indicates whether or not aggregation is enabled.

aggregate_key[W]

Key used in Redis for an individual’s aggregate feed.

items_loader[RW]

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.

namespace[W]

ActivityFeed namespace for Redis.

page_size[W]

Page size to be used when paging through the activity feed.

redis[RW]

Redis instance.

Public Instance Methods

aggregate() click to toggle source

Indicates whether or not aggregation is enabled.

@return whether or not aggregation is enabled or the default of false if not set.

# File lib/activity_feed/configuration.rb, line 50
def aggregate
  @aggregate ||= false
end
aggregate_key() click to toggle source

Key used in Redis for an individul’s aggregate feed.

@return the key used in Redis for an individual’s aggregate feed or the default of ‘aggregate’ if not set.

# File lib/activity_feed/configuration.rb, line 57
def aggregate_key
  @aggregate_key ||= 'aggregate'
end
configure() { |self| ... } click to toggle source

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
# File lib/activity_feed/configuration.rb, line 36
def configure
  yield self
end
namespace() click to toggle source

ActivityFeed namespace for Redis.

@return the ActivityFeed namespace or the default of ‘activity_feed’ if not set.

# File lib/activity_feed/configuration.rb, line 43
def namespace
  @namespace ||= 'activity_feed'
end
page_size() click to toggle source

Default page size.

@return the page size or the default of 25 if not set.

# File lib/activity_feed/configuration.rb, line 64
def page_size
  @page_size ||= 25
end