Module: Amico::Configuration
- Included in:
- Amico
- Defined in:
- lib/amico/configuration.rb
Overview
Configuration settings for Amico.
Instance Attribute Summary collapse
-
#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.
-
#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_key ⇒ Object
Key used in Redis for tracking who an individual blocks.
78 79 80 |
# File 'lib/amico/configuration.rb', line 78 def blocked_key @blocked_key ||= 'blocked' end |
#default_scope_key ⇒ Object
Default key used in Redis for tracking scope for the given relationship calls.
99 100 101 |
# File 'lib/amico/configuration.rb', line 99 def default_scope_key @default_scope_key ||= 'default' end |
#followers_key ⇒ Object
Key used in Redis for tracking the followers of an individual.
71 72 73 |
# File 'lib/amico/configuration.rb', line 71 def followers_key @followers_key ||= 'followers' end |
#following_key ⇒ Object
Key used in Redis for tracking who an individual is following.
64 65 66 |
# File 'lib/amico/configuration.rb', line 64 def following_key @following_key ||= 'following' end |
#namespace ⇒ Object
Amico namespace for Redis.
57 58 59 |
# File 'lib/amico/configuration.rb', line 57 def namespace @namespace ||= 'amico' end |
#page_size ⇒ Object
Page size to be used when paging through the various types of relationships.
113 114 115 |
# File 'lib/amico/configuration.rb', line 113 def page_size @page_size ||= 25 end |
#pending_follow ⇒ Object
Key used to indicate whether or not a follow should be pending or not.
106 107 108 |
# File 'lib/amico/configuration.rb', line 106 def pending_follow @pending_follow ||= false end |
#pending_key ⇒ Object
Key used in Redis for tracking pending follow relationships for an individual.
92 93 94 |
# File 'lib/amico/configuration.rb', line 92 def pending_key @pending_key ||= 'pending' end |
#reciprocated_key ⇒ Object
Key used in Redis for tracking who has reciprocated a follow for an individual.
85 86 87 |
# File 'lib/amico/configuration.rb', line 85 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.reciprocated_key = 'reciprocated'
configuration.pending_key = 'pending'
configuration.default_scope_key = 'default'
configuration.pending_follow = false
configuration.page_size = 25
end
50 51 52 |
# File 'lib/amico/configuration.rb', line 50 def configure yield self end |