Class: OPML2HTML::HTMLDocument
- Inherits:
-
Object
- Object
- OPML2HTML::HTMLDocument
- Defined in:
- lib/opml2html/html_document.rb
Instance Method Summary collapse
- #body ⇒ Object
- #create_element(name) ⇒ Object
- #head ⇒ Object
-
#initialize ⇒ HTMLDocument
constructor
A new instance of HTMLDocument.
- #main ⇒ Object
- #metadata ⇒ Object
Constructor Details
#initialize ⇒ HTMLDocument
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
#body ⇒ Object
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 |
#head ⇒ Object
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 |
#main ⇒ Object
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 |
#metadata ⇒ Object
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 |