Class: Docxer::Word::Headers

Inherits:
Object
  • Object
show all
Defined in:
lib/docxer/word/headers.rb,
lib/docxer/word/headers/header.rb

Defined Under Namespace

Classes: Header

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHeaders

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

#counterObject

Returns the value of attribute counter.



7
8
9
# File 'lib/docxer/word/headers.rb', line 7

def counter
  @counter
end

#headersObject

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

#sequenceObject



18
19
20
# File 'lib/docxer/word/headers.rb', line 18

def sequence
  @counter += 1
end