Module: Net::HTTPHeader

Defined in:
lib/persevere_client.rb

Instance Method Summary collapse

Instance Method Details

#content_rangeObject

Returns a Range object which represents Content-Range: header field. This indicates, for a partial entity body, where this fragment fits inside the full entity body, as range of byte offsets.



22
23
24
25
26
27
# File 'lib/persevere_client.rb', line 22

def content_range
  return nil unless @header['content-range']
   m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or
       return nil
   m[1].to_i .. m[2].to_i + 1
end

#old_content_rangeObject



18
# File 'lib/persevere_client.rb', line 18

alias old_content_range content_range