philnash / bitly

🗜 A Ruby wrapper for the bit.ly API
https://rubygems.org/gems/bitly
MIT License
451 stars 139 forks source link

Alias to_s on Url objects to short_url #48

Closed cableray closed 8 years ago

cableray commented 11 years ago

I'm thinking that to_s on the url objects should return the short url.

cableray commented 11 years ago

Hm, that's wierd, in rails to_s does give the short url, but the console gives the class descriptor.

philnash commented 8 years ago

Sorry for leaving such an old issue for such a long time.

I don't know why Rails would show the short_url when using to_s however I don't think that's the correct behaviour. There are many ways of starting with one type of URL and ending up with the URL object that the short_url isn't always the obvious thing you were after so preferring it in to_s might be counter intuitive. I'd rather each version of the URL was only available as it's attribute.