Class: Docxtor2::ElementList
- Inherits:
-
Object
- Object
- Docxtor2::ElementList
- Defined in:
- lib/docxtor2/element_list.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ElementList
constructor
A new instance of ElementList.
Constructor Details
#initialize ⇒ ElementList
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 |