Class: Uniword::Caption::CrossReference
- Inherits:
-
Object
- Object
- Uniword::Caption::CrossReference
- Defined in:
- lib/uniword/caption/cross_reference.rb
Overview
Builds a REF fldSimple that references a bookmark, producing
display text like "Figure 3" or "Table 2" when Word renders it.
For Word to refresh these fields on open, set
Settings#update_fields (the w:updateFields element) to
UpdateFields.new before saving.
Instance Method Summary collapse
- #build ⇒ Wordprocessingml::SimpleField
-
#initialize(bookmark_name) ⇒ CrossReference
constructor
A new instance of CrossReference.
Constructor Details
#initialize(bookmark_name) ⇒ CrossReference
Returns a new instance of CrossReference.
13 14 15 |
# File 'lib/uniword/caption/cross_reference.rb', line 13 def initialize(bookmark_name) @bookmark_name = bookmark_name end |
Instance Method Details
#build ⇒ Wordprocessingml::SimpleField
18 19 20 21 22 23 |
# File 'lib/uniword/caption/cross_reference.rb', line 18 def build Wordprocessingml::SimpleField.new( instr: instruction, runs: [placeholder_run], ) end |