Class: Nwodkram
- Inherits:
-
Object
- Object
- Nwodkram
- Defined in:
- lib/nwodkram.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
Instance Method Summary collapse
-
#initialize(html) ⇒ Nwodkram
constructor
A new instance of Nwodkram.
- #to_markdown ⇒ Object
Constructor Details
#initialize(html) ⇒ Nwodkram
Returns a new instance of Nwodkram.
7 8 9 |
# File 'lib/nwodkram.rb', line 7 def initialize(html) @html = html end |
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html.
5 6 7 |
# File 'lib/nwodkram.rb', line 5 def html @html end |
Instance Method Details
#to_markdown ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/nwodkram.rb', line 11 def to_markdown parser = Nokogiri::HTML::SAX::Parser.new(NwodkramParser.new) out = StringIO.new $stdout = out parser.parse(@html) out.string ensure $stdout = STDOUT end |