Class: HTMLRenderer::Text
Overview
Strips out everything but the plain text.
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
41 42 43 |
# File 'lib/html-renderer/text.rb', line 41 def div(text) text + "\n" end |
#header(text, header_level) ⇒ Object
53 54 55 |
# File 'lib/html-renderer/text.rb', line 53 def header(text, header_level) text + "\n" end |
#image(link, title, content) ⇒ Object
36 37 38 39 |
# File 'lib/html-renderer/text.rb', line 36 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
32 33 34 |
# File 'lib/html-renderer/text.rb', line 32 def link(link, title, content) "#{content} (#{link})" end |
#paragraph(text) ⇒ Object
45 46 47 |
# File 'lib/html-renderer/text.rb', line 45 def paragraph(text) div(text) + "\n" end |
#separator ⇒ Object
49 50 51 |
# File 'lib/html-renderer/text.rb', line 49 def separator "______________________\n\n" end |
#table(header, body) ⇒ Object
57 58 59 |
# File 'lib/html-renderer/text.rb', line 57 def table(header, body) "#{header}#{body}" end |
#table_cell(content, alignment) ⇒ Object
65 66 67 |
# File 'lib/html-renderer/text.rb', line 65 def table_cell(content, alignment) content + "\t" end |
#table_row(content) ⇒ Object
61 62 63 |
# File 'lib/html-renderer/text.rb', line 61 def table_row(content) content + "\n" end |