Class: Unshorten
- Inherits:
-
Object
- Object
- Unshorten
- Defined in:
- lib/unshorten.rb
Overview
Get original URLs from shortened ones.
Constant Summary collapse
- CACHE_SIZE_LIMIT =
Cache entities limit
1024
- DEFAULT_OPTIONS =
Default options for unshorten
{ :max_level => 10, :timeout => 2, :short_hosts => false, :short_urls => /^(?:https?:)?\/*[^\/]*\/*[^\/]*$/, :use_cache => true, :add_missing_http => true }
- @@cache =
{ }
Class Method Summary collapse
-
.unshorten(url, options = {}) ⇒ Object
(also: [])
Unshorten a URL.
Class Method Details
.unshorten(url, options = {}) ⇒ Object Also known as: []
Unshorten a URL
44 45 46 47 48 |
# File 'lib/unshorten.rb', line 44 def unshorten(url, = {}) DEFAULT_OPTIONS.each { |k, v| ([k] = v) unless .has_key? k } follow(url, ) end |