module Flocks::Configuration

Configuration settings for Flocks.

Attributes

blocked_by_key[W]

Key used in Redis for tracking who has blocked an individual.

blocked_key[W]

Key used in Redis for tracking who an individual blocks.

followers_key[W]

Key used in Redis for tracking the followers of an individual.

following_key[W]

Key used in Redis for tracking who an individual is following.

namespace[W]

Flocks namespace for Redis.

page_size[W]

Page size to be used when paging through the various types of relationships.

pending_follow[W]

Key used to indicate whether or not a follow should be pending or not.

pending_key[W]

Key used in Redis for tracking pending follow relationships for an individual.

pending_with_key[W]

Key used in Redis for tracking who an individual is awaiting approval from.

reciprocated_key[W]

Key used in Redis for tracking who has reciprocated a follow for an individual.

redis[RW]

Redis instance.

string_score_percision[W]

Set the percision for relationship sorting granularity

Public Instance Methods

blocked_by_key() click to toggle source

Key used in Redis for tracking who has blocked an individual.

@return the key used in Redis for tracking who has blocked an individual or the default of ‘blocked_by’ if not set.

# File lib/flocks/configuration.rb, line 88
def blocked_by_key
  @blocked_by_key ||= 'blocked_by'
end
blocked_key() click to toggle source

Key used in Redis for tracking who an individual blocks.

@return the key used in Redis for tracking who an individual blocks or the default of ‘blocked’ if not set.

# File lib/flocks/configuration.rb, line 81
def blocked_key
  @blocked_key ||= 'blocked'
end
configure() { |self| ... } click to toggle source

Yield self to be able to configure Flocks with block-style configuration.

Example:

Flocks.configure do |configuration|
  configuration.redis = Redis.new
  configuration.namespace = 'flocks'
  configuration.following_key = 'following'
  configuration.followers_key = 'followers'
  configuration.blocked_key = 'blocked'
  configuration.blocked_by_key = 'blocked_by'
  configuration.page_size = 25
end
# File lib/flocks/configuration.rb, line 53
def configure
  yield self
end
followers_key() click to toggle source

Key used in Redis for tracking the followers of an individual.

@return the key used in Redis for tracking the followers of an individual or the default of ‘followers’ if not set.

# File lib/flocks/configuration.rb, line 74
def followers_key
  @followers_key ||= 'followers'
end
following_key() click to toggle source

Key used in Redis for tracking who an individual is following.

@return the key used in Redis for tracking who an individual is following or the default of ‘following’ if not set.

# File lib/flocks/configuration.rb, line 67
def following_key
  @following_key ||= 'following'
end
namespace() click to toggle source

Flocks namespace for Redis.

@return the Flocks namespace or the default of ‘flocks’ if not set.

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

Page size to be used when paging through the various types of relationships.

@return the page size to be used when paging through the various types of relationships or the default of 25 if not set.

# File lib/flocks/configuration.rb, line 102
def page_size
  @page_size ||= 25
end
reciprocated_key() click to toggle source

Key used in Redis for tracking who has reciprocated a follow for an individual.

@return the key used in Redis for tracking who has reciprocated a follow for an individual or the default of ‘reciprocated’ if not set.

# File lib/flocks/configuration.rb, line 95
def reciprocated_key
  @reciprocated_key ||= 'reciprocated'
end
string_score_percision() click to toggle source

Number of characters to be used when scoring a username for indexing in redis

@return the scoring percision

# File lib/flocks/configuration.rb, line 109
def string_score_percision
  @string_score_percision ||= 5
end