class Shale::Adapter::REXML::Document

Wrapper around REXML API

@api private

Attributes

doc[R]

Return REXML document

@return [::REXML::Document]

@api private

Public Class Methods

new() click to toggle source

Initialize object

@api private

# File lib/shale/adapter/rexml.rb, line 55
def initialize
  @doc = ::REXML::Document.new
end

Public Instance Methods

add_attribute(element, name, value) click to toggle source

Add attribute to REXML element

@param [::REXML::Element] element REXML element @param [String] name Name of the XML attribute @param [String] value Value of the XML attribute

@api private

# File lib/shale/adapter/rexml.rb, line 77
def add_attribute(element, name, value)
  element.add_attribute(name, value)
end
add_element(element, child) click to toggle source

Add child element to REXML element

@param [::REXML::Element] element REXML parent element @param [::REXML::Element] child REXML child element

@api private

# File lib/shale/adapter/rexml.rb, line 87
def add_element(element, child)
  element.add_element(child)
end
add_text(element, text) click to toggle source

Add text node to REXML element

@param [::REXML::Element] element REXML element @param [String] text Text to add

@api private

# File lib/shale/adapter/rexml.rb, line 97
def add_text(element, text)
  element.add_text(text)
end
create_element(name) click to toggle source

Create REXML element

@param [String] name Name of the XML element

@return [::REXML::Element]

@api private

# File lib/shale/adapter/rexml.rb, line 66
def create_element(name)
  ::REXML::Element.new(name)
end