Sha256: 8ef7dd5f882b0938b10f629dabf9cb02d642bc45f5d74231fb06d1d749e838a3

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 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 = QPush.redis.with 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.4 lib/qpush/web/apis/history.rb