Class: Mush::Services::Unu

Inherits:
Mush::Service show all
Defined in:
lib/mush/services/unu.rb

Instance Method Summary collapse

Methods inherited from Mush::Service

#authorize, #get

Instance Method Details

#shorten(url) ⇒ Object

Raises:



8
9
10
11
12
13
14
# File 'lib/mush/services/unu.rb', line 8

def shorten(url)
  raise InvalidURI.new("Please provide a valid URI") if url.empty?
  
  options = {}
  options[:query] = {:url => url}
  get('/unu-api-simple', options).body.chomp
end