Class: Docxer::Word::Footers::Footer::PageNumbers
- Inherits:
-
Object
- Object
- Docxer::Word::Footers::Footer::PageNumbers
- Defined in:
- lib/docxer/word/footers/footer.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PageNumbers
constructor
A new instance of PageNumbers.
- #render(xml) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PageNumbers
Returns a new instance of PageNumbers.
57 58 59 |
# File 'lib/docxer/word/footers/footer.rb', line 57 def initialize(={}) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
56 57 58 |
# File 'lib/docxer/word/footers/footer.rb', line 56 def @options end |
Instance Method Details
#render(xml) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/docxer/word/footers/footer.rb', line 61 def render(xml) xml['w'].sdt do xml['w'].sdtPr do xml['w'].id( 'w:val' => "-472213903" ) xml['w'].docPartObj do xml['w'].docPartGallery( 'w:val' => "Page Numbers (Bottom of Page)" ) xml['w'].docPartUnique end end xml['w'].sdtContent do xml['w'].p do xml['w'].pPr do xml['w'].jc( 'w:val' => @options[:align] || 'right' ) end xml['w'].r do xml['w'].fldChar( 'w:fldCharType' => "begin" ) end xml['w'].r do xml['w'].instrText "PAGE \* MERGEFORMAT" end xml['w'].r do xml['w'].fldChar( 'w:fldCharType' => "separate" ) end xml['w'].r do xml['w'].fldChar( 'w:fldCharType' => "end" ) end end end end end |