Module: Vonage::Authentication

Included in:
Client
Defined in:
lib/vonage/authentication.rb

Instance Method Summary collapse

Instance Method Details

#authenticateObject



4
5
6
7
8
9
# File 'lib/vonage/authentication.rb', line 4

def authenticate
  params = {login: @login, password: @password}
  get_response = get "/appserver/rest/user/null", params

  @cookies = parse_cookies(get_response)
end

#authenticated?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/vonage/authentication.rb', line 11

def authenticated?
  !@cookies.empty?
end

#reauthenticateObject



15
16
17
18
# File 'lib/vonage/authentication.rb', line 15

def reauthenticate
  @cookies = CookieHash.new
  authenticate
end