class Typhoeus::Response

Custom Response class

Public Instance Methods

html() click to toggle source

@return [ Nokogiri::XML ] The response's body parsed by Nokogiri::HTML

# File lib/cms_scanner/typhoeus/response.rb, line 7
def html
  @html ||= Nokogiri::HTML(body.encode('UTF-8', invalid: :replace, undef: :replace))
end
request_size() click to toggle source

Override of the original to ensure an integer is returned @return [ Integer ]

Calls superclass method
# File lib/cms_scanner/typhoeus/response.rb, line 18
def request_size
  super || 0
end
size() click to toggle source

@return [ Integer ]

# File lib/cms_scanner/typhoeus/response.rb, line 23
def size
  (body.nil? ? 0 : body.size) + (response_headers.nil? ? 0 : response_headers.size)
end
xml() click to toggle source

@return [ Nokogiri::XML ] The response's body parsed by Nokogiri::XML

# File lib/cms_scanner/typhoeus/response.rb, line 12
def xml
  @xml ||= Nokogiri::XML(body.encode('UTF-8', invalid: :replace, undef: :replace))
end