Class: Docxtor2::Package::Document::Element

Inherits:
ElementList
  • Object
show all
Includes:
BlockEvaluator, ObjectUtils
Defined in:
lib/docxtor2/package/document/element.rb

Direct Known Subclasses

PageBreak, Paragraph, TableOfContents

Instance Method Summary collapse

Methods included from ObjectUtils

#find_argument

Methods included from BlockEvaluator

#evaluate

Methods inherited from ElementList

map

Constructor Details

#initialize(*args, &block) ⇒ Element

Returns a new instance of Element.



6
7
8
9
10
# File 'lib/docxtor2/package/document/element.rb', line 6

def initialize(*args, &block)
  @params = create_attributes(args)
  @block = block
  super()
end

Instance Method Details

#render(xml) ⇒ Object



12
13
14
15
# File 'lib/docxtor2/package/document/element.rb', line 12

def render(xml)
  @xml = xml
  evaluate &@block
end