Module: Docxer::Word::Helpers

Included in:
Document
Defined in:
lib/docxer/word/helpers.rb

Instance Method Summary collapse

Instance Method Details

#br(options = {}) ⇒ Object



11
12
13
14
15
# File 'lib/docxer/word/helpers.rb', line 11

def br(options={})
  element = Docxer::Word::Contents::Break.new(options)
  @content << element
  element
end

#p(options = {}, &block) ⇒ Object



17
18
19
20
21
# File 'lib/docxer/word/helpers.rb', line 17

def p(options={}, &block)
  element = Docxer::Word::Contents::Paragraph.new(options, &block)
  @content << element
  element
end

#table(options = {}, &block) ⇒ Object



29
30
31
32
33
# File 'lib/docxer/word/helpers.rb', line 29

def table(options={}, &block)
  table = Docxer::Word::Contents::Table.new(options, &block)
  @content << table
  table
end

#table_of_content(options = {}, &block) ⇒ Object



23
24
25
26
27
# File 'lib/docxer/word/helpers.rb', line 23

def table_of_content(options={}, &block)
  toc = Docxer::Word::Contents::TableOfContent.new(options, &block)
  @content << toc
  toc
end

#text(text, options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/docxer/word/helpers.rb', line 5

def text(text, options={})
  p(options) do |p|
    p.text text
  end
end