Class: Rubyword::Element::PageBreak
- Defined in:
- lib/rubyword/element/page_break.rb
Instance Attribute Summary collapse
-
#numbers ⇒ Object
Returns the value of attribute numbers.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Rubyword::Element::Base
Instance Attribute Details
#numbers ⇒ Object
Returns the value of attribute numbers.
5 6 7 |
# File 'lib/rubyword/element/page_break.rb', line 5 def numbers @numbers end |
Instance Method Details
#save(numbers) ⇒ Object
7 8 9 10 |
# File 'lib/rubyword/element/page_break.rb', line 7 def save(numbers) @numbers ||= Queue.new @numbers << numbers.to_i end |
#write(section = nil, xml = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rubyword/element/page_break.rb', line 12 def write(section=nil, xml=nil) @xml = xml page_break = self.numbers.pop page_break.to_i.times.each do |i| @xml.send('w:p') { @xml.send('w:r') { @xml.send('w:br', 'w:type' => 'page') } } end end |