MRod15 / hashtml

HashTML is a gem for parsing HTML documents to Ruby Hash-like objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve node modification when using attributes to identify the target node

MRod15 opened this issue · comments

When trying to modify a node using attributes to identify the target node, currently it is not possible to do something like:

@source.document.html.body.div({ 'class' => 'cucumber' }).script({ 'id' => 'script_totals' }) = totals

Workaround:

@source.document.html.body.div({ 'class' => 'cucumber' }).send(:script=, { 'id' => 'script_totals' }, totals)