Method: BitlyApi::Bitly#expand

Defined in:
lib/bitly-api/bitly-api.rb

#expand(short_url) ⇒ Object

Raises:



28
29
30
31
32
33
# File 'lib/bitly-api/bitly-api.rb', line 28

def expand(short_url)
  http_response = @httpclient.get_content(build_url("expand", "shortUrl=#{short_url}"))
  data = JSON.parse(http_response)
  raise BitlyError.new(data["errorMessage"]) unless data["statusCode"] == "OK"
  data["results"][short_url]
end