Class: IntervalResponse::Empty

Inherits:
Abstract
  • Object
show all
Defined in:
lib/interval_response/empty.rb

Overview

Serves out a response that is of size 0

Instance Method Summary collapse

Methods inherited from Abstract

#each, #etag, #initialize, #multiple_ranges?, #satisfied_with_first_interval?, #to_rack_response_triplet

Constructor Details

This class inherits a constructor from IntervalResponse::Abstract

Instance Method Details

#content_lengthObject



7
8
9
# File 'lib/interval_response/empty.rb', line 7

def content_length
  0
end

#headersObject



11
12
13
14
15
16
17
18
# File 'lib/interval_response/empty.rb', line 11

def headers
  {
    'Accept-Ranges' => 'bytes',
    'Content-Length' => '0',
    'Content-Type' => 'binary/octet-stream',
    'ETag' => etag,
  }
end

#status_codeObject



3
4
5
# File 'lib/interval_response/empty.rb', line 3

def status_code
  200
end