Module: Docx::Elements::Element::ClassMethods
- Defined in:
- lib/docx/elements/element.rb
Instance Method Summary collapse
Instance Method Details
#create_with(element) ⇒ Object
59 60 61 62 |
# File 'lib/docx/elements/element.rb', line 59 def create_with(element) # Need to somehow get the xml document accessible here by default, but this is alright in the interim self.new(Nokogiri::XML::Node.new("w:#{self.const_get(:TAG)}", element.node)) end |
#create_within(element) ⇒ Object
64 65 66 67 68 |
# File 'lib/docx/elements/element.rb', line 64 def create_within(element) new_element = create_with(element) new_element.append_to(element) new_element end |