Class: Docxer::Word::Contents::Break
- Inherits:
-
Object
- Object
- Docxer::Word::Contents::Break
- Defined in:
- lib/docxer/word/contents/break.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Break
constructor
A new instance of Break.
- #render(xml) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Break
Returns a new instance of Break.
8 9 10 11 |
# File 'lib/docxer/word/contents/break.rb', line 8 def initialize(={}) @options = @options[:times] ||= 1 end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/docxer/word/contents/break.rb', line 7 def @options end |
Instance Method Details
#render(xml) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/docxer/word/contents/break.rb', line 13 def render(xml) if @options[:page] xml['w'].p do xml['w'].r do xml['w'].br( 'w:type' => "page" ) end end else @options[:times].times do xml['w'].r do xml['w'].br end end end end |