Class: XlsxWriter::HeaderFooter
- Inherits:
-
Object
- Object
- XlsxWriter::HeaderFooter
- Defined in:
- lib/xlsx_writer/header_footer.rb
Defined Under Namespace
Classes: HF
Instance Attribute Summary collapse
-
#footer ⇒ Object
readonly
Returns the value of attribute footer.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
-
#initialize ⇒ HeaderFooter
constructor
A new instance of HeaderFooter.
- #to_xml ⇒ Object
Constructor Details
#initialize ⇒ HeaderFooter
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
#footer ⇒ Object (readonly)
Returns the value of attribute footer.
4 5 6 |
# File 'lib/xlsx_writer/header_footer.rb', line 4 def @footer end |
#header ⇒ Object (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_xml ⇒ Object
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 << .to_xml lines << %{</headerFooter>} if header.has_image? or .has_image? lines << %{<legacyDrawingHF r:id="rId1"/>} end lines.join("\n") end |