Class: HTTP::Features::AutoDeflate::CompressedBody
Instance Attribute Summary
#source
Instance Method Summary
collapse
#==
Constructor Details
#initialize(uncompressed_body) ⇒ CompressedBody
Returns a new instance of CompressedBody.
55
56
57
58
|
# File 'lib/http/features/auto_deflate.rb', line 55
def initialize(uncompressed_body)
@body = uncompressed_body
@compressed = nil
end
|
Instance Method Details
#each(&block) ⇒ Object
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/http/features/auto_deflate.rb', line 65
def each(&block)
return to_enum __method__ unless block
if @compressed
compressed_each(&block)
else
compress(&block)
end
self
end
|
#size ⇒ Object
60
61
62
63
|
# File 'lib/http/features/auto_deflate.rb', line 60
def size
compress_all! unless @compressed
@compressed.size
end
|