Class | HTML5::TreeBuilders::Hpricot::Element::AttributeProxy |
In: |
lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb
|
Parent: | Object |
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.
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 94 94: def initialize(hpricot) 95: @hpricot = hpricot 96: end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 98 98: def []=(k, v) 99: @hpricot.stag.send(stag_attributes_method)[k] = v 100: end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 107 107: def method_missing(*a, &b) 108: @hpricot.attributes.send(*a, &b) 109: end