module Cequel::Record
Constants
- DUMP_ATTRS
Public Class Methods
redis()
click to toggle source
Getter for redis object @return [Redis] redis cache instance
# File lib/octocore/models.rb, line 23 def self.redis @redis end
update_cache_config(host, port)
click to toggle source
Updates caching config @param [String] host The host to connect to @param [Fixnum] port The port to connect to
# File lib/octocore/models.rb, line 15 def self.update_cache_config(host, port) @redis = Redis.new(host: host, port: port, driver: :hiredis) end
Public Instance Methods
marshal_dump()
click to toggle source
# File lib/octocore/models.rb, line 27 def marshal_dump DUMP_ATTRS.inject({}) do |val, attr| val[attr] = self.instance_variable_get(attr) val end end
marshal_load(data)
click to toggle source
# File lib/octocore/models.rb, line 34 def marshal_load(data) DUMP_ATTRS.each do |attr| instance_variable_set(attr, data[attr]) end instance_variable_set(:@collection_proxies, {}) instance_variable_set(:@record_collection, nil) end