Class: HTMLRenderer::Text
Overview
Everything-stripping renderer.
Instance Method Summary collapse
- #div(text) ⇒ Object
- #header(text, header_level) ⇒ Object
- #image(link, title, content) ⇒ Object
-
#link(link, title, content) ⇒ Object
Other methods where we don’t return only a specific argument.
- #paragraph(text) ⇒ Object
- #separator ⇒ Object
- #table(header, body) ⇒ Object
- #table_cell(content, alignment) ⇒ Object
- #table_row(content) ⇒ Object
Methods inherited from Base
Instance Method Details
#div(text) ⇒ Object
40 41 42 |
# File 'lib/html-renderer/text.rb', line 40 def div(text) text + "\n" end |
#header(text, header_level) ⇒ Object
52 53 54 |
# File 'lib/html-renderer/text.rb', line 52 def header(text, header_level) text + "\n" end |
#image(link, title, content) ⇒ Object
35 36 37 38 |
# File 'lib/html-renderer/text.rb', line 35 def image(link, title, content) content &&= content + " " "#{content}#{link}" end |
#link(link, title, content) ⇒ Object
Other methods where we don’t return only a specific argument
31 32 33 |
# File 'lib/html-renderer/text.rb', line 31 def link(link, title, content) "#{content} (#{link})" end |
#paragraph(text) ⇒ Object
44 45 46 |
# File 'lib/html-renderer/text.rb', line 44 def paragraph(text) div(text) + "\n" end |
#separator ⇒ Object
48 49 50 |
# File 'lib/html-renderer/text.rb', line 48 def separator "______________________\n\n" end |
#table(header, body) ⇒ Object
56 57 58 |
# File 'lib/html-renderer/text.rb', line 56 def table(header, body) "#{header}#{body}" end |
#table_cell(content, alignment) ⇒ Object
64 65 66 |
# File 'lib/html-renderer/text.rb', line 64 def table_cell(content, alignment) content + "\t" end |
#table_row(content) ⇒ Object
60 61 62 |
# File 'lib/html-renderer/text.rb', line 60 def table_row(content) content + "\n" end |