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.
52
53
54
55
|
# File 'lib/http/features/auto_deflate.rb', line 52
def initialize(uncompressed_body)
@body = uncompressed_body
@compressed = nil
end
|
Instance Method Details
#each(&block) ⇒ Object
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/http/features/auto_deflate.rb', line 62
def each(&block)
return to_enum __method__ unless block
if @compressed
compressed_each(&block)
else
compress(&block)
end
self
end
|
#size ⇒ Object
57
58
59
60
|
# File 'lib/http/features/auto_deflate.rb', line 57
def size
compress_all! unless @compressed
@compressed.size
end
|