Sha256: 3f9bf07fe61f36d343a4e79b88201b9ee0f2f8e571f5e25b97cd144c79635773

Contents?: true

Size: 393 Bytes

Versions: 58

Compression:

Stored size: 393 Bytes

Contents

module Rpush
  module Daemon
    class RetryHeaderParser
      def self.parse(header)
        new(header).parse
      end

      def initialize(header)
        @header = header
      end

      def parse
        return unless @header

        if @header.to_s =~ /^[0-9]+$/
          Time.now + @header.to_i
        else
          Time.httpdate(@header)
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
rpush-9.1.0 lib/rpush/daemon/retry_header_parser.rb
rpush-9.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-8.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-7.0.1 lib/rpush/daemon/retry_header_parser.rb
rpush-7.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-6.0.1 lib/rpush/daemon/retry_header_parser.rb
rpush-6.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-5.4.0 lib/rpush/daemon/retry_header_parser.rb
rpush-5.3.0 lib/rpush/daemon/retry_header_parser.rb
rpush-5.2.0 lib/rpush/daemon/retry_header_parser.rb
rpush-5.1.0 lib/rpush/daemon/retry_header_parser.rb
rpush-5.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-4.2.0 lib/rpush/daemon/retry_header_parser.rb
rpush-4.1.1 lib/rpush/daemon/retry_header_parser.rb
rpush-4.1.0 lib/rpush/daemon/retry_header_parser.rb
rpush-4.0.1 lib/rpush/daemon/retry_header_parser.rb
rpush-4.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-3.3.1 lib/rpush/daemon/retry_header_parser.rb
rpush-3.3.0 lib/rpush/daemon/retry_header_parser.rb
rpush_extended-3.2.6 lib/rpush/daemon/retry_header_parser.rb