Class: HTOTConv::Parser::HtmlList

Inherits:
Base
  • Object
show all
Defined in:
lib/htot_conv/parser/html_list.rb

Defined Under Namespace

Classes: ListDoc

Instance Attribute Summary

Attributes inherited from Base

#option

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from HTOTConv::Parser::Base

Class Method Details

.option_helpObject



7
8
9
10
11
12
13
14
15
# File 'lib/htot_conv/parser/html_list.rb', line 7

def self.option_help
  {
    :key_header => {
      :default => [],
      :pat => Array,
      :desc => "key header",
    },
  }
end

Instance Method Details

#parse(input) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/htot_conv/parser/html_list.rb', line 17

def parse(input)
  outline = HTOTConv::Outline.new
  outline.key_header = @option[:key_header]
  outline.value_header = []

  parser = Nokogiri::HTML::SAX::Parser.new(ListDoc.new(outline))
  parser.parse(input)

  outline
end