Class: Nwodkram

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#htmlObject

Returns the value of attribute html.



5
6
7
# File 'lib/nwodkram.rb', line 5

def html
  @html
end

Instance Method Details

#to_markdownObject



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