Class: HTTP::MimeType::HTML

Inherits:
Adapter
  • Object
show all
Defined in:
lib/http/mime_type/html.rb

Overview

This allows you to call ‘response.parse` and get back a Nokogiri object if the content type is HTML.

Instance Method Summary collapse

Instance Method Details

#decode(str) ⇒ Object



10
11
12
# File 'lib/http/mime_type/html.rb', line 10

def decode(str)
  Nokogiri::HTML(str)
end

#encode(obj) ⇒ Object



6
7
8
# File 'lib/http/mime_type/html.rb', line 6

def encode(obj)
  obj.to_s if obj
end