Class: NQXML::Node

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

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object



24
25
26
# File 'lib/xmlrpc/parser.rb', line 24

def [] (index)
  @children[index]
end

#childNodesObject



18
19
20
# File 'lib/xmlrpc/parser.rb', line 18

def childNodes
  @children
end

#hasChildNodesObject



21
22
23
# File 'lib/xmlrpc/parser.rb', line 21

def hasChildNodes
  not @children.empty?
end

#nodeNameObject



41
42
43
44
# File 'lib/xmlrpc/parser.rb', line 41

def nodeName
  #TODO: error when wrong Entity-type
  @entity.name
end

#nodeTypeObject



28
29
30
31
32
33
34
35
# File 'lib/xmlrpc/parser.rb', line 28

def nodeType
  if @entity.instance_of? NQXML::Text then :TEXT
  elsif @entity.instance_of? NQXML::Comment then :COMMENT
  #elsif @entity.instance_of? NQXML::Element then :ELEMENT
  elsif @entity.instance_of? NQXML::Tag then :ELEMENT
  else :ELSE
  end
end

#nodeValueObject



37
38
39
40
# File 'lib/xmlrpc/parser.rb', line 37

def nodeValue
  #TODO: error when wrong Entity-type
  @entity.text
end

#removeChild(node) ⇒ Object



15
16
17
# File 'lib/xmlrpc/parser.rb', line 15

def removeChild(node)
  @children.delete(node)
end