Class: IEgrip::Document

Inherits:
Node show all
Includes:
ElementChild, GetElements, Retry
Defined in:
lib/iegrip.rb

Overview

IE.Document

Constant Summary

Constants included from Retry

Retry::RETRY_INTERVAL

Constants inherited from Node

Node::NODETYPE_DIC

Instance Method Summary collapse

Methods included from Retry

#retryCheck, #retryGetTarget

Methods included from GetElements

#getElementByName, #getElementByText, #getElementByTitle, #getElementByValue, #getElementsByName, #getElementsByTagName, #getElementsByText, #getElementsByTitle, #getElementsByValue

Methods included from ElementChild

#childElements, #childNodes, #contains, #firstChild, #hasChildElements, #hasChildNodes, #isEqualNode, #lastChild, #nextSibling, #previousSibling, #struct

Methods inherited from Node

#inspect, #nodeName, #nodeType, #nodeTypeName

Methods inherited from GripWrapper

#initialize, #inspect, #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

#allObject



413
414
415
416
417
418
# File 'lib/iegrip.rb', line 413

def all
  retryGetTarget {
    raw_all = @raw_object.all
    raw_all ? HTMLElementCollection.new(raw_all, @ie_obj) : nil
  }
end

#bodyObject



406
407
408
409
410
411
# File 'lib/iegrip.rb', line 406

def body()
  retryGetTarget {
    raw_body = @raw_object.body
    raw_body ? HTMLElement.new(@raw_object.body, @ie_obj) : nil
  }
end

#createAttribute(attr_name) ⇒ Object



450
451
452
453
# File 'lib/iegrip.rb', line 450

def createAttribute(attr_name)
  raw_attr = @raw_object.createAttribute(attr_name)
  Attr.new(raw_attr, @ie_obj)
end

#createElement(tag_name) ⇒ Object



445
446
447
448
# File 'lib/iegrip.rb', line 445

def createElement(tag_name)
  raw_element = @raw_object.createElement(tag_name)
  HTMLElement.new(raw_element, @ie_obj)
end

#documentElementObject



438
439
440
441
442
443
# File 'lib/iegrip.rb', line 438

def documentElement
  retryGetTarget {
    raw_element = @raw_object.documentElement()
    raw_element ? HTMLElement.new(raw_element, @ie_obj) : nil
  }
end

#frames(index = nil) ⇒ Object



420
421
422
423
424
425
426
427
428
429
# File 'lib/iegrip.rb', line 420

def frames(index=nil)
  if index
    frames = retryGetTarget { @raw_object.Frames }
    return nil unless frames
    return nil if index >= frames.length
    Frames.new(@raw_object.frames, @ie_obj)[index]
  else
    Frames.new(@raw_object.frames, @ie_obj)
  end
end

#getElementById(element_id) ⇒ Object



431
432
433
434
435
436
# File 'lib/iegrip.rb', line 431

def getElementById(element_id)
  retryGetTarget {
    raw_element = @raw_object.getElementById(element_id)
    raw_element ? HTMLElement.new(raw_element, @ie_obj) : nil
  }
end

#headObject



399
400
401
402
403
404
# File 'lib/iegrip.rb', line 399

def head()
  retryGetTarget { 
    raw_head = @raw_object.head
    raw_head ? HTMLElement.new(raw_head, @ie_obj) : nil
  }
end