Class: XML::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/libxml_rexml_compat.rb

Overview

This adds some methods to the xml/libxml library to make it easier to re-use code written for the REXML api.

Defined Under Namespace

Modules: REXMLCompat

Instance Method Summary collapse

Instance Method Details

#add_attribute(key, val) ⇒ Object



13
14
15
# File 'lib/libxml_rexml_compat.rb', line 13

def add_attribute(key, val)
  self[key] = val
end

#attributesObject



9
10
11
# File 'lib/libxml_rexml_compat.rb', line 9

def attributes
  self
end

#elementsObject



17
18
19
# File 'lib/libxml_rexml_compat.rb', line 17

def elements
  REXMLCompat::Elements.new(self)
end

#textObject



5
6
7
# File 'lib/libxml_rexml_compat.rb', line 5

def text
  content
end