Module: Amico::Configuration
- Included in:
- Amico
- Defined in:
- lib/amico/configuration.rb
Overview
Configuration settings for Amico.
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.
-
#default_scope_key ⇒ Object
Default key used in Redis for tracking scope for the given relationship calls.
-
#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
Amico namespace for Redis.
-
#page_size ⇒ Object
Page size to be used when paging through the various types of relationships.
-
#pending_follow ⇒ Object
Key used to indicate whether or not a follow should be pending or not.
-
#pending_key ⇒ Object
Key used in Redis for tracking pending follow relationships for an individual.
-
#pending_with_key ⇒ Object
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.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure Amico with block-style configuration.
Instance Attribute Details
#blocked_by_key ⇒ Object
Key used in Redis for tracking who has blocked an individual.
93 94 95 |
# File 'lib/amico/configuration.rb', line 93 def blocked_by_key @blocked_by_key ||= 'blocked_by' end |
#blocked_key ⇒ Object
Key used in Redis for tracking who an individual blocks.
86 87 88 |
# File 'lib/amico/configuration.rb', line 86 def blocked_key @blocked_key ||= 'blocked' end |
#default_scope_key ⇒ Object
Default key used in Redis for tracking scope for the given relationship calls.
121 122 123 |
# File 'lib/amico/configuration.rb', line 121 def default_scope_key @default_scope_key ||= 'default' end |
#followers_key ⇒ Object
Key used in Redis for tracking the followers of an individual.
79 80 81 |
# File 'lib/amico/configuration.rb', line 79 def followers_key @followers_key ||= 'followers' end |
#following_key ⇒ Object
Key used in Redis for tracking who an individual is following.
72 73 74 |
# File 'lib/amico/configuration.rb', line 72 def following_key @following_key ||= 'following' end |
#namespace ⇒ Object
Amico namespace for Redis.
65 66 67 |
# File 'lib/amico/configuration.rb', line 65 def namespace @namespace ||= 'amico' end |
#page_size ⇒ Object
Page size to be used when paging through the various types of relationships.
135 136 137 |
# File 'lib/amico/configuration.rb', line 135 def page_size @page_size ||= 25 end |
#pending_follow ⇒ Object
Key used to indicate whether or not a follow should be pending or not.
128 129 130 |
# File 'lib/amico/configuration.rb', line 128 def pending_follow @pending_follow ||= false end |
#pending_key ⇒ Object
Key used in Redis for tracking pending follow relationships for an individual.
107 108 109 |
# File 'lib/amico/configuration.rb', line 107 def pending_key @pending_key ||= 'pending' end |
#pending_with_key ⇒ Object
Key used in Redis for tracking who an individual is awaiting approval from.
114 115 116 |
# File 'lib/amico/configuration.rb', line 114 def pending_with_key @pending_with_key ||= 'pending_with' end |
#reciprocated_key ⇒ Object
Key used in Redis for tracking who has reciprocated a follow for an individual.
100 101 102 |
# File 'lib/amico/configuration.rb', line 100 def reciprocated_key @reciprocated_key ||= 'reciprocated' end |
#redis ⇒ Object
Redis instance.
5 6 7 |
# File 'lib/amico/configuration.rb', line 5 def redis @redis end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure Amico with block-style configuration.
Example:
Amico.configure do |configuration|
configuration.redis = Redis.new
configuration.namespace = 'amico'
configuration.following_key = 'following'
configuration.followers_key = 'followers'
configuration.blocked_key = 'blocked'
configuration.blocked_by_key = 'blocked_by'
configuration.reciprocated_key = 'reciprocated'
configuration.pending_key = 'pending'
configuration.pending_with_key = 'pending_with'
configuration.default_scope_key = 'default'
configuration.pending_follow = false
configuration.page_size = 25
end
58 59 60 |
# File 'lib/amico/configuration.rb', line 58 def configure yield self end |