Module: Docxi::Word::Helpers
- Included in:
- Document
- Defined in:
- lib/docxi/word/helpers.rb
Instance Method Summary collapse
- #br(options = {}) ⇒ Object
- #frame(text, options = {}) ⇒ Object
- #p(options = {}, &block) ⇒ Object
- #tab(options = {}) ⇒ Object
- #table(options = {}, &block) ⇒ Object
- #table_of_content(options = {}, &block) ⇒ Object
- #text(text, options = {}) ⇒ Object
Instance Method Details
#br(options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/docxi/word/helpers.rb', line 17 def br(={}) element = Docxi::Word::Contents::Break.new() @content << element element end |
#frame(text, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/docxi/word/helpers.rb', line 11 def frame(text, ={}) p() do |p| p.frame text end end |
#p(options = {}, &block) ⇒ Object
29 30 31 32 33 |
# File 'lib/docxi/word/helpers.rb', line 29 def p(={}, &block) element = Docxi::Word::Contents::Paragraph.new(, &block) @content << element element end |
#tab(options = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/docxi/word/helpers.rb', line 23 def tab(={}) element = Docxi::Word::Contents::Tab.new() @content << element element end |
#table(options = {}, &block) ⇒ Object
41 42 43 44 45 |
# File 'lib/docxi/word/helpers.rb', line 41 def table(={}, &block) table = Docxi::Word::Contents::Table.new(, &block) @content << table table end |
#table_of_content(options = {}, &block) ⇒ Object
35 36 37 38 39 |
# File 'lib/docxi/word/helpers.rb', line 35 def table_of_content(={}, &block) toc = Docxi::Word::Contents::TableOfContent.new(, &block) @content << toc toc end |
#text(text, options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/docxi/word/helpers.rb', line 5 def text(text, ={}) p() do |p| p.text text end end |