Sunday, May 26, 2013

[Rails] Re: URI::Generic methods

Matt Jones wrote in post #1110185:

> Quickest way is to read the source (available from the 'click to toggle
> source' link you get when hovering over a method):

> def normalize!
> if path && path == ''
> set_path('/')
> end
> if scheme && scheme != scheme.downcase
> set_scheme(self.scheme.downcase)
> end
> if host && host != host.downcase
> set_host(self.host.downcase)
> end
> end

> looks like the idea is to handle the following oddly-formatted sorts of
> URIs:
>
> http://example.com (no trailing /)
> HttP://example.com/ (protocol capitalized oddly)
> http://EXAMPLE.com/ (host capitalized)

Thanks @matt! I am happy to see this.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5e3f990a0dedce1d7605b1ac9a6cc022%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate