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-2.3.2 lib/rpush/daemon/retry_header_parser.rb
rpush-2.3.1-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.3.1 lib/rpush/daemon/retry_header_parser.rb
rpush-2.3.0-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.3.0 lib/rpush/daemon/retry_header_parser.rb
rpush-2.3.0.rc1 lib/rpush/daemon/retry_header_parser.rb
rpush-2.2.0-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.2.0 lib/rpush/daemon/retry_header_parser.rb
rpush-2.1.0-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.1.0 lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.1-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.1 lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.0-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.0 lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.0.rc1-java lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.0.rc1 lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.0.beta2 lib/rpush/daemon/retry_header_parser.rb
rpush-2.0.0.beta1 lib/rpush/daemon/retry_header_parser.rb