class DocxGenerator::Word::Tab

Represent the ‘w:tab` element from Office Open XML specification. This class should not be used directly by the users of the library.

Public Class Methods

new(options = {}) click to toggle source

Create a new ‘w:tab` element. @param options [Hash] Options for the tab stop. Must be `leader`, `pos` or `val`. See the specification for the possible values for each option.

Calls superclass method DocxGenerator::Element::new
# File lib/docx_generator/word/formatting.rb, line 111
def initialize(options = {})
  final_arguments = {}
  options.each do |name, value|
    if name.to_s == "pos"
      final_arguments["w:pos"] = (value * 20).round
    else
      final_arguments["w:" + name.to_s] = value
    end
  end
  super("w:tab", final_arguments)
end