Sha256: 007f43d3d140073e49a892ce3a53bb09f4a7b0c4a137ababaec735ef7803d063

Contents?: true

Size: 462 Bytes

Versions: 2

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(Web.keys[:history], 0, 10)
          end
        end

        def update_jobs
          @jobs.map! { |i| JSON.parse(i) }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qpush-0.1.10 lib/qpush/web/apis/history.rb
qpush-0.1.8 lib/qpush/web/apis/history.rb