twingly/twingly-url

Methods for checking if a URL component exists

roback opened this issue · 5 comments

A Twingly::URL#trd? method would have been nice to have in https://github.com/twingly/norrstrom/pull/102 instead of having to do !url.trd.empty?.

A #path? method could also be added, and possibly others too.

jage commented

Great idea!

I think so too.

walro commented

Indeed!

walro commented

Maybe it would be suited with some metaprogramming here, extend every component method with a predicate ditto that's pretty much implemented as !property.empty?.