Parent

Class/Module Index [+]

Quicksearch

HTML5::TreeBuilders::Hpricot::Element::AttributeProxy

A call to Hpricot::Elem#raw_attributes is built dynamically, so alterations to the returned value (a hash) will be lost.

AttributeProxy works around this by forwarding :[]= calls to the raw_attributes accessor on the element start tag.

Public Class Methods

new(hpricot) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 94
def initialize(hpricot)
  @hpricot = hpricot
end

Public Instance Methods

[]=(k, v) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 98
def []=(k, v)
  @hpricot.stag.send(stag_attributes_method)[k] = v
end
method_missing(*a, &b) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 107
def method_missing(*a, &b)
  @hpricot.attributes.send(*a, &b)
end
stag_attributes_method() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 102
def stag_attributes_method
  # STag#attributes changed to STag#raw_attributes after Hpricot 0.5
  @hpricot.stag.respond_to?(:raw_attributes) ? :raw_attributes : :attributes
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.