twingly/twingly-url

Feature: Twingly::URL#normalized?

jage opened this issue · 0 comments

jage commented

I would like to be able to ask the object if it's normalized: Twingly::URL#normalized?

A basic implementation could be self.to_s == self.normalized.to_s.

An optimization could be to set a boolean when #normalized is called. This boolean could then be checked in #normalized to return self instead of a new normalized instance. It would improve the performance when #normalized and #normalized? are called multiple times.