Sha256: f9b684a3fa883768e3c7b5b5675fd46a8a65aa84a8bbd16702ee282da425b45f

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

module QPush
  module Web
    module Apis
      class Morgue
        def initialize(start, count)
          @morgue = nil
          @start = start
          @count = count
        end

        def call
          retrieve_morgue
          update_morgue
        end

        private

        def retrieve_morgue
          @morgue = Web.redis do |conn|
            conn.lrange(Web.keys.morgue, @start, @start + @count)
          end
        end

        def update_morgue
          @morgue.map! { |i| JSON.parse(i) }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qpush-0.1.7 lib/qpush/web/apis/morgue.rb