Class: DocxGenerator::Word::Spacing
- Defined in:
- lib/docx_generator/word/formatting.rb
Overview
Represent the ‘w:spacing` element from Office Open XML specification. This class should not be used directly by the users of the library.
Instance Method Summary collapse
-
#initialize(arguments = {}) ⇒ Spacing
constructor
Create a new ‘w:spacing` element.
Methods inherited from Element
Constructor Details
#initialize(arguments = {}) ⇒ Spacing
Create a new ‘w:spacing` element.
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/docx_generator/word/formatting.rb', line 64 def initialize(arguments = {}) final_arguments = {} arguments.each do |name, value| if name.to_s == "after" || name.to_s == "before" final_arguments["w:" + name.to_s] = (value * 20).round else final_arguments["w:" + name.to_s] = (value * 20 * 12).round final_arguments["w:lineRule"] = "auto" end end super("w:spacing", final_arguments) end |