Sha256: f6d1df1a78a040bb4c337456e72bf3645075c7cc63346e56598982aa941fd938

Contents?: true

Size: 403 Bytes

Versions: 2

Compression:

Stored size: 403 Bytes

Contents

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

      def initialize(header)
        @header = header
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rpush-1.0.0-java lib/rpush/daemon/retry_header_parser.rb
rpush-1.0.0 lib/rpush/daemon/retry_header_parser.rb