Class: Docxer::Word::Headers
- Inherits:
-
Object
- Object
- Docxer::Word::Headers
- Defined in:
- lib/docxer/word/headers.rb,
lib/docxer/word/headers/header.rb
Defined Under Namespace
Classes: Header
Instance Attribute Summary collapse
-
#counter ⇒ Object
Returns the value of attribute counter.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
- #add(header) ⇒ Object
-
#initialize ⇒ Headers
constructor
A new instance of Headers.
- #render(zip) ⇒ Object
- #sequence ⇒ Object
Constructor Details
#initialize ⇒ Headers
Returns a new instance of Headers.
8 9 10 11 |
# File 'lib/docxer/word/headers.rb', line 8 def initialize @headers = [] @counter = 0 end |
Instance Attribute Details
#counter ⇒ Object
Returns the value of attribute counter.
7 8 9 |
# File 'lib/docxer/word/headers.rb', line 7 def counter @counter end |
#headers ⇒ Object
Returns the value of attribute headers.
7 8 9 |
# File 'lib/docxer/word/headers.rb', line 7 def headers @headers end |
Instance Method Details
#add(header) ⇒ Object
13 14 15 16 |
# File 'lib/docxer/word/headers.rb', line 13 def add(header) @headers << header header end |
#render(zip) ⇒ Object
22 23 24 25 26 |
# File 'lib/docxer/word/headers.rb', line 22 def render(zip) @headers.each do |header| header.render(zip) end end |
#sequence ⇒ Object
18 19 20 |
# File 'lib/docxer/word/headers.rb', line 18 def sequence @counter += 1 end |