Class: HtmlToTextile
- Inherits:
-
Object
- Object
- HtmlToTextile
- Defined in:
- lib/html_to_textile.rb
Defined Under Namespace
Classes: Document
Instance Method Summary collapse
-
#initialize(string) ⇒ HtmlToTextile
constructor
A new instance of HtmlToTextile.
- #to_html ⇒ Object
- #to_textile ⇒ Object
Constructor Details
#initialize(string) ⇒ HtmlToTextile
Returns a new instance of HtmlToTextile.
206 207 208 209 210 211 |
# File 'lib/html_to_textile.rb', line 206 def initialize(string) @tree = [] @document = Document.new parser = ::Nokogiri::HTML::SAX::Parser.new(@document) parser.parse(string) end |
Instance Method Details
#to_html ⇒ Object
217 218 219 |
# File 'lib/html_to_textile.rb', line 217 def to_html @document.to_html end |
#to_textile ⇒ Object
213 214 215 |
# File 'lib/html_to_textile.rb', line 213 def to_textile @document.to_textile end |