Class: Shortly::Clients::Tinyurl
- Inherits:
-
Shortly::Client
- Object
- Shortly::Client
- Shortly::Clients::Tinyurl
- Defined in:
- lib/shortly/clients/tinyurl.rb
Class Method Summary collapse
-
.shorten(url, options = {}) ⇒ Object
shorts provided url by making call to tinyurl api with given options.
Methods inherited from Shortly::Client
Class Method Details
.shorten(url, options = {}) ⇒ Object
shorts provided url by making call to tinyurl api with given options.
32 33 34 35 36 |
# File 'lib/shortly/clients/tinyurl.rb', line 32 def self.shorten(url, = {}) validate_uri!(url) response = post("/api-create.php", post_params({:url => url})).chomp OpenStruct.new({:shorturl => response}) end |