Class: DocxGenerator::Word::Tabs

Inherits:
Element
  • Object
show all
Defined in:
lib/docx_generator/word/formatting.rb

Overview

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

Instance Method Summary collapse

Methods inherited from Element

#add, #generate

Constructor Details

#initialize(tab_stops) ⇒ Tabs

Create a new ‘w:tabs` element.

Parameters:

  • tab_stops (Array)

    The tab stops.



99
100
101
102
103
104
# File 'lib/docx_generator/word/formatting.rb', line 99

def initialize(tab_stops)
  tab_stop_elements = tab_stops.inject([]) do |tab_stop_elements, tab_stop|
    tab_stop_elements << Tab.new(tab_stop)
  end
  super("w:tabs", {}, tab_stop_elements)
end