lib/ormivore/redis_adapter.rb
def find_by_id(id, attributes_to_load, options = {})
      quiet = options.fetch(:quiet, false)

      raise ArgumentError unless id
      raise ArgumentError unless attributes_to_load && !attributes_to_load.empty?
      redis_reference = "#{prefix}:#{id}"
      if redis.exists(redis_reference)
        rtn = redis.mapped_hmget(redis_reference, *attributes_to_load).symbolize_keys
        attributes_to_load.include?(:id) ? rtn.merge(id: id) : rtn
      elsif quiet
        nil
      else
        raise RecordNotFound, "Entity with id #{id} does not exist"
      end
    end
# options attribute is strictly private implementation detail
options attribute is strictly private implementation detail
options attribute is strictly private implementation detail
def find_by_id(id, attributes_to_load, options = {})
      quiet = options.fetch(:quiet, false)
      raise ArgumentError unless id
      raise ArgumentError unless attributes_to_load && !attributes_to_load.empty?
      redis_reference = "#{prefix}:#{id}"
      if redis.exists(redis_reference)
        rtn = redis.mapped_hmget(redis_reference, *attributes_to_load).symbolize_keys
        attributes_to_load.include?(:id) ? rtn.merge(id: id) : rtn
      elsif quiet
        nil
      else
        raise RecordNotFound, "Entity with id #{id} does not exist"
      end
    end
def find_by_id ( id , attributes_to_load , options = { } ) quiet = options . fetch ( :quiet , false ) raise ArgumentError unless id raise ArgumentError unless attributes_to_load && ! attributes_to_load . empty? redis_reference = "#{prefix}:#{id}" if redis . exists ( redis_reference ) rtn = redis . mapped_hmget ( redis_reference , * attributes_to_load ) . symbolize_keys attributes_to_load . include? ( :id ) ? rtn . merge ( id : id ) : rtn elsif quiet nil else raise RecordNotFound , "Entity with id #{id} does not exist" end end
options attribute is strictly private implementation detail
options attribute is strictly private implementation detail
id
attributes_to_load
options