Class: HtmlToTextile

Inherits:
Object
  • Object
show all
Defined in:
lib/html_to_textile.rb

Defined Under Namespace

Classes: Document

Instance Method Summary collapse

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_htmlObject



217
218
219
# File 'lib/html_to_textile.rb', line 217

def to_html
  @document.to_html
end

#to_textileObject



213
214
215
# File 'lib/html_to_textile.rb', line 213

def to_textile
  @document.to_textile
end