Sha256: 25c620dd3a910b64661c8a33a2b2cf73d42028172a89ba829c73066a91c30db6

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

module QPush
  module Web
    module Apis
      class History
        def initialize
          @jobs = nil
        end

        def call
          retrieve_jobs
          update_jobs
        end

        private

        def retrieve_jobs
          @jobs = Web.redis do |conn|
            conn.lrange(QPush.keys.history, 0, 10)
          end
        end

        def update_jobs
          @jobs.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/history.rb