Sha256: 3057dc7ce2a337f22ad163168df0c7130a776fc4b8b81eedf6a10436163769ff

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 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 = QPush.redis.with do |conn|
            conn.lrange(QPush.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.4 lib/qpush/web/apis/morgue.rb