Class: Bitlyr::Strategy::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bitlyr/strategy/base.rb

Direct Known Subclasses

AccessToken, ApiKey, OAuth

Instance Method Summary collapse

Instance Method Details

#request(*args) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/bitlyr/strategy/base.rb', line 4

def request(*args)
  response = Bitlyr::Response.new(run_request(*args))
  if response.success?
    response.body
  else
    raise BitlyrError.new(response)
  end
end

#validate(x_login, x_api_key) ⇒ Object Also known as: valid?

Validates a login and api key



14
15
16
17
# File 'lib/bitlyr/strategy/base.rb', line 14

def validate(, x_api_key)
  response = request(:get, :validate, :x_login => , :x_apiKey => x_api_key)
  return response['valid'] == 1
end