Module: Flocks::Configuration
- Included in:
- Flocks
- Defined in:
- lib/flocks/configuration.rb
Overview
Configuration settings for Flocks.
Instance Attribute Summary collapse
-
#blocked_by_key ⇒ Object
Key used in Redis for tracking who has blocked an individual.
-
#blocked_key ⇒ Object
Key used in Redis for tracking who an individual blocks.
-
#followers_key ⇒ Object
Key used in Redis for tracking the followers of an individual.
-
#following_key ⇒ Object
Key used in Redis for tracking who an individual is following.
-
#namespace ⇒ Object
Flocks namespace for Redis.
-
#page_size ⇒ Object
Page size to be used when paging through the various types of relationships.
-
#pending_follow ⇒ Object
writeonly
Key used to indicate whether or not a follow should be pending or not.
-
#pending_key ⇒ Object
writeonly
Key used in Redis for tracking pending follow relationships for an individual.
-
#pending_with_key ⇒ Object
writeonly
Key used in Redis for tracking who an individual is awaiting approval from.
-
#reciprocated_key ⇒ Object
Key used in Redis for tracking who has reciprocated a follow for an individual.
-
#redis ⇒ Object
Redis instance.
-
#string_score_percision ⇒ Object
Number of characters to be used when scoring a username for indexing in redis.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure Flocks with block-style configuration.
Instance Attribute Details
#blocked_by_key ⇒ Object
Key used in Redis for tracking who has blocked an individual.
88 89 90 |
# File 'lib/flocks/configuration.rb', line 88 def blocked_by_key @blocked_by_key ||= 'blocked_by' end |
#blocked_key ⇒ Object
Key used in Redis for tracking who an individual blocks.
81 82 83 |
# File 'lib/flocks/configuration.rb', line 81 def blocked_key @blocked_key ||= 'blocked' end |
#followers_key ⇒ Object
Key used in Redis for tracking the followers of an individual.
74 75 76 |
# File 'lib/flocks/configuration.rb', line 74 def followers_key @followers_key ||= 'followers' end |
#following_key ⇒ Object
Key used in Redis for tracking who an individual is following.
67 68 69 |
# File 'lib/flocks/configuration.rb', line 67 def following_key @following_key ||= 'following' end |
#namespace ⇒ Object
Flocks namespace for Redis.
60 61 62 |
# File 'lib/flocks/configuration.rb', line 60 def namespace @namespace ||= 'flocks' end |
#page_size ⇒ Object
Page size to be used when paging through the various types of relationships.
102 103 104 |
# File 'lib/flocks/configuration.rb', line 102 def page_size @page_size ||= 25 end |
#pending_follow=(value) ⇒ Object (writeonly)
Key used to indicate whether or not a follow should be pending or not.
32 33 34 |
# File 'lib/flocks/configuration.rb', line 32 def pending_follow=(value) @pending_follow = value end |
#pending_key=(value) ⇒ Object (writeonly)
Key used in Redis for tracking pending follow relationships for an individual.
26 27 28 |
# File 'lib/flocks/configuration.rb', line 26 def pending_key=(value) @pending_key = value end |
#pending_with_key=(value) ⇒ Object (writeonly)
Key used in Redis for tracking who an individual is awaiting approval from.
29 30 31 |
# File 'lib/flocks/configuration.rb', line 29 def pending_with_key=(value) @pending_with_key = value end |
#reciprocated_key ⇒ Object
Key used in Redis for tracking who has reciprocated a follow for an individual.
95 96 97 |
# File 'lib/flocks/configuration.rb', line 95 def reciprocated_key @reciprocated_key ||= 'reciprocated' end |
#redis ⇒ Object
Redis instance.
5 6 7 |
# File 'lib/flocks/configuration.rb', line 5 def redis @redis end |
#string_score_percision ⇒ Object
Number of characters to be used when scoring a username for indexing in redis
109 110 111 |
# File 'lib/flocks/configuration.rb', line 109 def string_score_percision @string_score_percision ||= 5 end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
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
53 54 55 |
# File 'lib/flocks/configuration.rb', line 53 def configure yield self end |