Class: Docxi::Word::Footers::Footer::PageNumbers
- Inherits:
-
Object
- Object
- Docxi::Word::Footers::Footer::PageNumbers
- Defined in:
- lib/docxi/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.
69 70 71 |
# File 'lib/docxi/word/footers/footer.rb', line 69 def initialize(={}) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
68 69 70 |
# File 'lib/docxi/word/footers/footer.rb', line 68 def @options end |
Instance Method Details
#render(xml) ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/docxi/word/footers/footer.rb', line 73 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'].rPr do xml['w'].rFonts( 'w:cs'=> 'Arial', 'w:ascii'=> 'Arial', 'w:hAnsi' => 'Arial' ) xml['w'].color( 'w:val' => '404040') xml['w'].sz( 'w:val' => '20' ) end xml['w'].t @options[:name].to_s+' ' 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 |