Class: XMLObject::Adapters::Base::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/xml-object/adapters.rb

Overview

:nodoc:

Direct Known Subclasses

LibXML::Element, REXML::Element

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Element

Returns a new instance of Element.



12
13
14
15
16
# File 'lib/xml-object/adapters.rb', line 12

def initialize(*args)

  @children = @element_nodes.map { |node| self.class.new(node) }
  @value = (not (text_value !~ /\S/)) ? text_value : cdata_value
end

Instance Attribute Details

#attributesObject

:nodoc:



10
11
12
# File 'lib/xml-object/adapters.rb', line 10

def attributes
  @attributes
end

#childrenObject

:nodoc:



10
11
12
# File 'lib/xml-object/adapters.rb', line 10

def children
  @children
end

#nameObject

:nodoc:



10
11
12
# File 'lib/xml-object/adapters.rb', line 10

def name
  @name
end

#rawObject

:nodoc:



10
11
12
# File 'lib/xml-object/adapters.rb', line 10

def raw
  @raw
end

#valueObject

:nodoc:



10
11
12
# File 'lib/xml-object/adapters.rb', line 10

def value
  @value
end