class XML::DOM::EntityReference

Class XML::DOM::EntityReference

superclass

Node

Class XML::DOM::EntityReference

superclass

Node

Public Class Methods

new(name, *children) click to toggle source

Class Methods

Calls superclass method XML::DOM::Node::new
# File lib/xml/dom/core.rb, line 3028
def initialize(name, *children)
  super(*children)
  raise "parameter error" if !name
  @name = name.freeze
end

Public Instance Methods

_checkNode(node) click to toggle source
# File lib/xml/dom/core.rb, line 3094
def _checkNode(node)
  unless node.nodeType == ELEMENT_NODE ||
      node.nodeType == PROCESSING_INSTRUCTION_NODE ||
      node.nodeType == COMMENT_NODE ||
      node.nodeType == TEXT_NODE ||
      node.nodeType == CDATA_SECTION_NODE ||
      node.nodeType == ENTITY_REFERENCE_NODE
    raise DOMException.new(DOMException::HIERARCHY_REQUEST_ERR)
  end
end
cloneNode(deep = true) click to toggle source
Calls superclass method XML::DOM::Node#cloneNode
# File lib/xml/dom/core.rb, line 3090
def cloneNode(deep = true)
  super(deep, @name)
end
dump(depth = 0) click to toggle source
# File lib/xml/dom/core.rb, line 3073
def dump(depth = 0)
  print ' ' * depth * 2
  print "&#{@name}{\n"
  @children.each do |child|
    child.dump(depth + 1)
  end if @children
  print ' ' * depth * 2
  print "}\n"
end
nodeName() click to toggle source
# File lib/xml/dom/core.rb, line 3054
def nodeName
  @name
end
nodeType() click to toggle source

Methods

# File lib/xml/dom/core.rb, line 3043
def nodeType
  ENTITY_REFERENCE_NODE
end
to_s() click to toggle source
# File lib/xml/dom/core.rb, line 3064
def to_s
  "&#{@name};"
end