Class: RedBlocks::Config
- Inherits:
-
Object
- Object
- RedBlocks::Config
- Defined in:
- lib/red_blocks/config.rb
Instance Attribute Summary collapse
-
#blank_id ⇒ Object
readonly
Used to represent a “blank” set.
-
#cache_client ⇒ Object
readonly
Returns the value of attribute cache_client.
-
#client_proc ⇒ Object
readonly
Proc which returns Redis client.
-
#infinity ⇒ Object
readonly
For test.
-
#intermediate_set_lifetime ⇒ Object
readonly
It is guaranteed that all set exist in 30 seconds at least.
-
#key_namespace ⇒ Object
readonly
The key prefix for Redis.
Instance Method Summary collapse
-
#initialize(client_proc:, cache_client: false, key_namespace:, intermediate_set_lifetime:, blank_id:, infinity: Float::INFINITY) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(client_proc:, cache_client: false, key_namespace:, intermediate_set_lifetime:, blank_id:, infinity: Float::INFINITY) ⇒ Config
Returns a new instance of Config.
21 22 23 24 25 26 27 28 |
# File 'lib/red_blocks/config.rb', line 21 def initialize(client_proc:, cache_client: false, key_namespace:, intermediate_set_lifetime:, blank_id:, infinity: Float::INFINITY) @key_namespace = key_namespace @intermediate_set_lifetime = intermediate_set_lifetime @blank_id = blank_id @client_proc = client_proc @cache_client = cache_client @infinity = infinity end |
Instance Attribute Details
#blank_id ⇒ Object (readonly)
Used to represent a “blank” set. So you cannot use 0 in real id.
16 17 18 |
# File 'lib/red_blocks/config.rb', line 16 def blank_id @blank_id end |
#cache_client ⇒ Object (readonly)
Returns the value of attribute cache_client.
5 6 7 |
# File 'lib/red_blocks/config.rb', line 5 def cache_client @cache_client end |
#client_proc ⇒ Object (readonly)
Proc which returns Redis client.
4 5 6 |
# File 'lib/red_blocks/config.rb', line 4 def client_proc @client_proc end |
#infinity ⇒ Object (readonly)
For test. See spec_helper.rb
19 20 21 |
# File 'lib/red_blocks/config.rb', line 19 def infinity @infinity end |
#intermediate_set_lifetime ⇒ Object (readonly)
It is guaranteed that all set exist in 30 seconds at least. This means that all transaction must be completed in the time.
12 13 14 |
# File 'lib/red_blocks/config.rb', line 12 def intermediate_set_lifetime @intermediate_set_lifetime end |
#key_namespace ⇒ Object (readonly)
The key prefix for Redis.
8 9 10 |
# File 'lib/red_blocks/config.rb', line 8 def key_namespace @key_namespace end |