Sha256: 1fe594a8c6eb3dc08e44a474f2f035d85617679ab121693515897767cbf1f553

Contents?: true

Size: 441 Bytes

Versions: 3

Compression:

Stored size: 441 Bytes

Contents

module Typhoeus
  # Custom Response class
  class Response
    # @return [ Nokogiri::HTML ] The response's body parsed by Nokogiri::HTML
    def html
      @html ||= Nokogiri::HTML(body.encode('UTF-8', invalid: :replace, undef: :replace))
    end

    # @return [ Nokogiri::XML ] The response's body parsed by Nokogiri::XML
    def xml
      @xml ||= Nokogiri::XML(body.encode('UTF-8', invalid: :replace, undef: :replace))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cms_scanner-0.0.40.2 lib/cms_scanner/typhoeus/response.rb
cms_scanner-0.0.40.1 lib/cms_scanner/typhoeus/response.rb
cms_scanner-0.0.40 lib/cms_scanner/typhoeus/response.rb