Class: Chef::HTTP::ValidateContentLength::ContentLengthCounter
- Inherits:
-
Object
- Object
- Chef::HTTP::ValidateContentLength::ContentLengthCounter
- Defined in:
- lib/chef/http/validate_content_length.rb
Instance Attribute Summary collapse
-
#content_length ⇒ Object
Returns the value of attribute content_length.
Instance Method Summary collapse
- #handle_chunk(chunk) ⇒ Object
-
#initialize ⇒ ContentLengthCounter
constructor
A new instance of ContentLengthCounter.
Constructor Details
#initialize ⇒ ContentLengthCounter
Returns a new instance of ContentLengthCounter.
34 35 36 |
# File 'lib/chef/http/validate_content_length.rb', line 34 def initialize @content_length = 0 end |
Instance Attribute Details
#content_length ⇒ Object
Returns the value of attribute content_length.
32 33 34 |
# File 'lib/chef/http/validate_content_length.rb', line 32 def content_length @content_length end |
Instance Method Details
#handle_chunk(chunk) ⇒ Object
38 39 40 41 |
# File 'lib/chef/http/validate_content_length.rb', line 38 def handle_chunk(chunk) @content_length += chunk.bytesize chunk end |