Class: OPML2HTML::HTMLDocument

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

Instance Method Summary collapse

Constructor Details

#initializeHTMLDocument

Returns a new instance of HTMLDocument.



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

def initialize
  @document = Nokogiri::HTML::Document.new
end

Instance Method Details

#bodyObject



16
17
18
19
20
21
# File 'lib/opml2html/html_document.rb', line 16

def body
  @body and return @body
  @body = create_element("body")
  root.add_child(@body)
  @body
end

#create_element(name) ⇒ Object



38
39
40
# File 'lib/opml2html/html_document.rb', line 38

def create_element(name)
  Element.new(name, @document)
end

#headObject



9
10
11
12
13
14
# File 'lib/opml2html/html_document.rb', line 9

def head
  @head and return @head
  @head = create_element("head")
  root.add_child(@head)
  @head
end

#mainObject



23
24
25
26
27
28
# File 'lib/opml2html/html_document.rb', line 23

def main
  @main and return @main
  @main = create_element("main")
  body.add_child(@main)
  @main
end

#metadataObject



30
31
32
33
34
35
36
# File 'lib/opml2html/html_document.rb', line 30

def 
   and return 
   = create_element("p")
  ["style"] = "text-align: right"
  main.add_child()
  
end