Class: XlsxWriter::HeaderFooter

Inherits:
Object
  • Object
show all
Defined in:
lib/xlsx_writer/header_footer.rb

Defined Under Namespace

Classes: HF

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHeaderFooter

Returns a new instance of HeaderFooter.



6
7
8
9
# File 'lib/xlsx_writer/header_footer.rb', line 6

def initialize
  @header = HF.new 'H', 'oddHeader'
  @footer = HF.new 'F', 'oddFooter'
end

Instance Attribute Details

Returns the value of attribute footer.



4
5
6
# File 'lib/xlsx_writer/header_footer.rb', line 4

def footer
  @footer
end

#headerObject (readonly)

Returns the value of attribute header.



3
4
5
# File 'lib/xlsx_writer/header_footer.rb', line 3

def header
  @header
end

Instance Method Details

#to_xmlObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/xlsx_writer/header_footer.rb', line 11

def to_xml
  lines = []
  lines << %{<headerFooter>}
  lines << header.to_xml
  lines << footer.to_xml
  lines << %{</headerFooter>}
  if header.has_image? or footer.has_image?
    lines << %{<legacyDrawingHF r:id="rId1"/>}
  end
  lines.join("\n")
end