Class: Docxtor2::ElementList

Inherits:
Object
  • Object
show all
Defined in:
lib/docxtor2/element_list.rb

Direct Known Subclasses

ContentBuilder, Package::Document::Element

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeElementList

Returns a new instance of ElementList.



3
4
5
# File 'lib/docxtor2/element_list.rb', line 3

def initialize
  @elements = []
end

Class Method Details

.map(mappings) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/docxtor2/element_list.rb', line 7

def self.map(mappings)
  mappings.each do |name, klass|
    define_method(name) do |*args, &block|
      self << klass.new(*args, &block)
    end
  end
end