Class: WebStat::FinalRedirectUrl
- Inherits:
-
Object
- Object
- WebStat::FinalRedirectUrl
- Defined in:
- lib/web_stat/final_redirect_url.rb
Class Method Summary collapse
Class Method Details
.final_redirect_url(url, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/web_stat/final_redirect_url.rb', line 7 def final_redirect_url(url, ={}) final_url = '' if is_valid_url?(url) begin redirect_lookup_depth = [:depth].to_i > 0 ? [:depth].to_i : 10 response_uri = get_final_redirect_url(url, redirect_lookup_depth) final_url = url_string_from_uri(response_uri) rescue => e # nothing end end final_url end |