Class: TP::Slide::Paragraph
Instance Attribute Summary
Attributes inherited from TP::Slide
#markdown
Instance Method Summary
collapse
Methods inherited from TP::Slide
#centered_header, #content, #frames, #header, #height, #initialize, #lines, #pdf_content_height, #pdf_content_top_left, #pdf_header_height
Constructor Details
This class inherits a constructor from TP::Slide
Instance Method Details
#hard_width? ⇒ Boolean
34
35
36
|
# File 'lib/tp/slide/paragraph.rb', line 34
def hard_width?
false
end
|
#paragraph ⇒ Object
23
24
25
26
27
28
|
# File 'lib/tp/slide/paragraph.rb', line 23
def paragraph
buffer = content.wrap Screen.width
buffer = buffer.center Screen.width if buffer.lines.one?
buffer
end
|
#render_pdf(pdf) ⇒ Object
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/tp/slide/paragraph.rb', line 2
def render_pdf(pdf)
pdf.text_box ,
align: :center,
overflow: :shrink_to_fit,
single_line: true,
height: ,
size:
pdf.text_box paragraph,
at: pdf_content_top_left(pdf),
height: pdf_content_height(pdf),
overflow: :shrink_to_fit,
valign: :center
end
|
#render_terminal ⇒ Object
17
18
19
20
21
|
# File 'lib/tp/slide/paragraph.rb', line 17
def render_terminal
+
"\n\n" +
paragraph
end
|
#width ⇒ Object
30
31
32
|
# File 'lib/tp/slide/paragraph.rb', line 30
def width
content.length
end
|