Class: HTMLRenderer::Text

Inherits:
Base
  • Object
show all
Defined in:
lib/html-renderer/text.rb

Overview

Everything-stripping renderer.

Instance Method Summary collapse

Methods inherited from Base

render, #render

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

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

#separatorObject



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