Class: ServeByteRange::EmptyBody

Inherits:
Object
  • Object
show all
Defined in:
lib/serve_byte_range.rb

Direct Known Subclasses

NotModifiedBody, Unsatisfiable

Instance Method Summary collapse

Instance Method Details

#content_lengthObject



68
69
70
# File 'lib/serve_byte_range.rb', line 68

def content_length
  0
end

#each(&blk) ⇒ Object



72
73
74
# File 'lib/serve_byte_range.rb', line 72

def each(&blk)
  # write nothing
end

#headersObject



76
77
78
79
80
81
# File 'lib/serve_byte_range.rb', line 76

def headers
  {
    "Accept-Ranges" => "bytes",
    "Content-Length" => content_length.to_s
  }
end

#statusObject



64
65
66
# File 'lib/serve_byte_range.rb', line 64

def status
  200
end