Sha256: a3b78d9f7f88d4d43c15e1fccd61ea820f18712e39f3339c8fa7de7447df6815

Contents?: true

Size: 347 Bytes

Versions: 7

Compression:

Stored size: 347 Bytes

Contents

class DOMNode
  def [](name)
    hasAttribute(name.to_s).zero? ? nil : getAttribute(name.to_s)
  end
end

[
  DOMNodeList,
  DOMHTMLOptionsCollection,
  DOMHTMLCollection
].each do |klass|
  klass.class_eval do
    def [](index)
      item(index)
    end
  end
end

class WebScriptObject
  def [](index)
    webScriptValueAtIndex(index)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
grope-0.2.2 lib/grope/dom_ext.rb
grope-0.2.0 lib/grope/dom_ext.rb
grope-0.1.4 lib/grope/dom_ext.rb
grope-0.1.3 lib/grope/dom_ext.rb
grope-0.1.2 lib/grope/dom_ext.rb
grope-0.1.1 lib/grope/dom_ext.rb
grope-0.0.4 lib/grope/dom_ext.rb