Method: Bitly::Url#initialize

Defined in:
lib/bitly/url.rb

#initialize(login, api_key, obj = nil) ⇒ Url

Returns a new instance of Url.

Raises:



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bitly/url.rb', line 9

def initialize(,api_key,obj=nil)
  unless obj.nil?
    raise BitlyError.new(obj['errorMessage'],obj['errorCode']) if obj['statusCode'] == "ERROR"
    instance_variablise(obj, VARIABLES)
    @info = obj.fetch(:info, nil)
    @stats = obj.fetch(:stats, nil)
  end
  @login = 
  @api_key = api_key
  raise ArgumentError.new("Please provide a login and api_key") if @login.nil? || @api_key.nil?
end