Module: ZaptIn

Defined in:
lib/zapt_in.rb,
lib/zapt_in/version.rb

Defined Under Namespace

Classes: Client, Error, Request, Url

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.setup {|client| ... } ⇒ Object

Useful to set ZaptIn client parameters.

ZaptIn.setup do |client|
  client.uri = "http://abr.io/api/links"
  client. = "login"
  client.key = "key"
end

Yields:

  • (client)


15
16
17
# File 'lib/zapt_in.rb', line 15

def self.setup
  yield(client) if block_given?
end

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

Shortcut to ZaptIn::Client.shorten



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

def self.shorten(long_url, options = {})
  client.shorten(long_url, options)
end