Method: DocxGenerator::Element#initialize

Defined in:
lib/docx_generator/element.rb

#initialize(name, attributes = {}, content = []) ⇒ Element

Create a new XML element.

Parameters:

  • name (String)

    The name of the XML element.

  • attributes (Hash) (defaults to: {})

    The attributes of the XML element.

  • content (Array) (defaults to: [])

    An array of the children of the XML element (other XML elements).



10
11
12
13
14
# File 'lib/docx_generator/element.rb', line 10

def initialize(name, attributes = {}, content = [])
  @name = name
  @attributes = attributes
  @content = content
end