Class: Twitter::Cache::Config
- Inherits:
-
Object
- Object
- Twitter::Cache::Config
- Defined in:
- lib/twitter/cache/config.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#redis ⇒ Object
Returns the value of attribute redis.
-
#ttl ⇒ Object
Returns the value of attribute ttl.
Instance Method Summary collapse
- #convert_user(raw) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #user_instance(&block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 |
# File 'lib/twitter/cache/config.rb', line 6 def initialize @namespace = 'twitter-cache-gem' end |
Instance Attribute Details
#namespace ⇒ Object
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/twitter/cache/config.rb', line 4 def namespace @namespace end |
#redis ⇒ Object
Returns the value of attribute redis.
4 5 6 |
# File 'lib/twitter/cache/config.rb', line 4 def redis @redis end |
#ttl ⇒ Object
Returns the value of attribute ttl.
4 5 6 |
# File 'lib/twitter/cache/config.rb', line 4 def ttl @ttl end |
Instance Method Details
#convert_user(raw) ⇒ Object
14 15 16 17 |
# File 'lib/twitter/cache/config.rb', line 14 def convert_user(raw) return raw unless @user_instance @user_instance.call(raw) end |
#user_instance(&block) ⇒ Object
10 11 12 |
# File 'lib/twitter/cache/config.rb', line 10 def user_instance(&block) @user_instance = block end |