Sha256: 09856c1122b9039be2c343ca3bafb36b2ac8084d72df2d5a11f59f0a09ec0d12

Contents?: true

Size: 556 Bytes

Versions: 1

Compression:

Stored size: 556 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(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.6 lib/qpush/web/apis/morgue.rb