| 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 95
95: def initialize(hpricot)
96: @hpricot = hpricot
97: end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 99
99: def []=(k, v)
100: @hpricot.stag.send(stag_attributes_method)[k] = v
101: end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 108
108: def method_missing(*a, &b)
109: @hpricot.attributes.send(*a, &b)
110: end