Module: FinalRedirectUrl
- Defined in:
- lib/final_redirect_urli.rb
Class Method Summary collapse
Class Method Details
.final_redirect_urli(url, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/final_redirect_urli.rb', line 7 def self.final_redirect_urli(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_urli(url, redirect_lookup_depth) final_url = url_string_from_uri(response_uri) rescue Exception => ex logger = Logger.new(STDOUT) logger.error(ex.) end end final_url end |