Class: IEgrip::Node

Inherits:
GripWrapper show all
Defined in:
lib/iegrip.rb

Overview

Node

Direct Known Subclasses

Document, HTMLElement

Constant Summary collapse

NODETYPE_DIC =
{
  1 => :ELEMENT_NODE,
  2 => :ATTRIBUTE_NODE,
  3 => :TEXT_NODE,
  4 => :CDATA_SECTION_NODE,
  5 => :ENTITY_REFERENCE_NODE,
  6 => :ENTITY_NODE,
  7 => :PROCESSING_INSTRUCTION_NODE,
  8 => :COMMENT_NODE,
  9 => :DOCUMENT_NODE,
  10 => :DOCUMENT_TYPE_NODE,
  11 => :DOCUMENT_FRAGMENT_NODE,
  12 => :NOTATION_NODE,
}

Instance Method Summary collapse

Methods inherited from GripWrapper

#initialize, #ole_methodNames, #raw

Constructor Details

This class inherits a constructor from IEgrip::GripWrapper

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IEgrip::GripWrapper

Instance Method Details

#inspectObject



357
358
359
360
361
362
363
364
# File 'lib/iegrip.rb', line 357

def inspect
  case self.nodeType
  when 3
    "<#{self.class}, Name:#{self.nodeName}, Text:#{self.wholeText.inspect}>"
  else
    "<#{self.class}, Name:#{self.nodeName}>"
  end
end

#nodeNameObject



344
345
346
# File 'lib/iegrip.rb', line 344

def nodeName
  @raw_object.nodeName
end

#nodeTypeObject



348
349
350
# File 'lib/iegrip.rb', line 348

def nodeType
  @raw_object.nodetype
end

#nodeTypeNameObject



352
353
354
355
# File 'lib/iegrip.rb', line 352

def nodeTypeName
  nodetype = @raw_object.nodetype
  NODETYPE_DIC[nodetype] || :UNKNOWN
end