Class: Shortly::Clients::Isgd

Inherits:
Shortly::Client show all
Defined in:
lib/shortly/clients/isgd.rb

Direct Known Subclasses

Vgd

Class Method Summary collapse

Methods inherited from Shortly::Client

method_missing

Class Method Details

.shorten(url, options = {}) ⇒ Object

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



32
33
34
35
36
37
# File 'lib/shortly/clients/isgd.rb', line 32

def self.shorten(url, options = {})
  validate_uri!(url)
  options = {:format => "json", :url => url}.merge(options)
  response = get("/create.php", get_params(options))
  OpenStruct.new(JSON.parse(response.body))
end