felipecsl / wombat

Lightweight Ruby web crawler/scraper with an elegant DSL which extracts structured data from pages.
https://felipecsl.github.io/wombat/
MIT License
1.31k stars 129 forks source link

Allow hash selector as last argument to property #78

Open elhil opened 6 years ago

elhil commented 6 years ago

Small API improvement idea: instead of

stuff({ css: 'div.some-class' }, :list)

I want to be able to write:

stuff :list, css: 'div.some-class'

To me, this reads more like idiomatic ruby.

For the edge case where a user specifies both positional and hash arguments, we could just accept the first one? Or merge the two?

If you think this is worth it, I'd be happy to make a PR 😄