Module: Familia::Base
Overview
Class Attribute Summary collapse
-
.dump_method ⇒ Object
Returns the value of attribute dump_method.
-
.features ⇒ Object
readonly
Returns the value of attribute features.
-
.load_method ⇒ Object
Returns the value of attribute load_method.
Class Method Summary collapse
Instance Method Summary collapse
- #generate_id ⇒ Object
-
#update_expiration(ttl: nil) ⇒ nil
Base implementation of update_expiration that maintains API compatibility with the :expiration feature’s implementation.
- #uuid ⇒ Object
Class Attribute Details
.dump_method ⇒ Object
Returns the value of attribute dump_method.
23 24 25 |
# File 'lib/familia/base.rb', line 23 def dump_method @dump_method end |
.features ⇒ Object (readonly)
Returns the value of attribute features.
22 23 24 |
# File 'lib/familia/base.rb', line 22 def features @features end |
.load_method ⇒ Object
Returns the value of attribute load_method.
23 24 25 |
# File 'lib/familia/base.rb', line 23 def load_method @load_method end |
Class Method Details
Instance Method Details
#generate_id ⇒ Object
51 52 53 54 |
# File 'lib/familia/base.rb', line 51 def generate_id @key ||= Familia.generate_id @key end |
#update_expiration(ttl: nil) ⇒ nil
This is a no-op implementation. Classes that need expiration functionality should include the :expiration feature.
Base implementation of update_expiration that maintains API compatibility with the :expiration feature’s implementation.
This is a no-op implementation that gets overridden by features like :expiration. It accepts an optional ttl parameter to maintain interface compatibility with the overriding implementations.
46 47 48 49 |
# File 'lib/familia/base.rb', line 46 def update_expiration(ttl: nil) Familia.ld "[update_expiration] Feature not enabled for #{self.class}. Key: #{rediskey} (caller: #{caller(1..1)})" nil end |
#uuid ⇒ Object
56 57 58 59 |
# File 'lib/familia/base.rb', line 56 def uuid @uuid ||= SecureRandom.uuid @uuid end |