Class: MultiShorten::UrlShortener

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/multi_shorten/url_shorteners.rb

Overview

Base class from which all other classes are derived

Direct Known Subclasses

B54, GooGl, IsGd, JumboTweet, Linkee, MetaMark, MtNy, QrCx, Shortr

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.shorten(url) ⇒ Hash

Returns shortened version of the url for the corresponding. This is the abstract class

Parameters:

  • url (String)

    the url to be shortened

Returns:

  • (Hash)

    the resulting hash with status -> either :success or :fail. If success it also includes the :short_url



16
17
# File 'lib/multi_shorten/url_shorteners.rb', line 16

def self.shorten url
end

Instance Method Details

#failObject

The hash that is returned when there is a failure



20
21
22
# File 'lib/multi_shorten/url_shorteners.rb', line 20

def fail
  { :status => :fail }
end