Class: Nekohtml::HtmlNodeList
- Includes:
- Enumerable
- Defined in:
- lib/nekohtml/html_document.rb
Instance Attribute Summary
Attributes inherited from HtmlThing
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(*args) ⇒ HtmlNodeList
constructor
A new instance of HtmlNodeList.
- #length ⇒ Object
Methods inherited from HtmlThing
Constructor Details
#initialize(*args) ⇒ HtmlNodeList
Returns a new instance of HtmlNodeList.
47 48 49 50 51 |
# File 'lib/nekohtml/html_document.rb', line 47 def initialize(*args) super # Just an alias @jnode_list = @java_object end |
Instance Method Details
#each ⇒ Object
57 58 59 60 61 |
# File 'lib/nekohtml/html_document.rb', line 57 def each @jnode_list.getLength().times do |i| yield HtmlNode.new(@jnode_list.item(i)) end end |
#length ⇒ Object
53 54 55 |
# File 'lib/nekohtml/html_document.rb', line 53 def length @jnode_list.getLength() end |