Module: CacheKeeper::CachedMethod::SerializableTarget
- Included in:
- CacheKeeper::CachedMethod
- Defined in:
- app/models/cache_keeper/cached_method/serializable_target.rb
Instance Method Summary collapse
Instance Method Details
#serialize_target(target) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/models/cache_keeper/cached_method/serializable_target.rb', line 6 def serialize_target(target) case [:serializer] when :new_instance CacheKeeper::NewInstanceSerializer.serialize target when :marshal CacheKeeper::MarshalSerializer.serialize target else raise "Unknown serializer: #{[:serializer]}" end rescue StandardError => e raise "Error serializing target using #{[:serializer]}: #{e}" end |
#serialize_target? ⇒ Boolean
2 3 4 |
# File 'app/models/cache_keeper/cached_method/serializable_target.rb', line 2 def serialize_target? [:serializer].present? end |