Methods for checking if a URL component exists
roback opened this issue · 5 comments
roback commented
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!
dentarg commented
I think so too.
walro commented
Indeed!
dentarg commented
Another use-case for #trd?
: https://github.com/twingly/remora/commit/40a000833c6a5523f3b592d8f4efc6fb0c3a995a
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?.