class Shortly::Clients::Tinyurl

Public Class Methods

shorten(url, options = {}) click to toggle source

shorts provided url by making call to tinyurl api with given options.

# File lib/shortly/clients/tinyurl.rb, line 32
def self.shorten(url, options = {})
  validate_uri!(url)
  response = post("/api-create.php", post_params({:url => url})).chomp
  OpenStruct.new({:shorturl => response})
end