Attributes
Public Class methods
new(response, options)
[show source]
# File lib/httpx/plugins/content_digest.rb 66 def initialize(response, options) 67 super 68 69 return unless response.headers.key?("content-digest") 70 71 should_validate = options.validate_content_digest 72 should_validate = should_validate.call(response) if should_validate.respond_to?(:call) 73 74 return unless should_validate 75 76 @content_digest_buffer = Response::Buffer.new( 77 threshold_size: @options.body_threshold_size, 78 bytesize: @length, 79 encoding: @encoding 80 ) 81 end
Public Instance methods
close()
[show source]
# File lib/httpx/plugins/content_digest.rb 88 def close 89 if @content_digest_buffer 90 @content_digest_buffer.close 91 @content_digest_buffer = nil 92 end 93 super 94 end
write(chunk)
[show source]
# File lib/httpx/plugins/content_digest.rb 83 def write(chunk) 84 @content_digest_buffer.write(chunk) if @content_digest_buffer 85 super 86 end