Class: CoreLibrary::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/apimatic-core-interfaces/types/authentication.rb

Overview

An interface for authenticating the HTTP requests. This class should not be instantiated but should be used as a base class for authenticating the request.

Instance Method Summary collapse

Instance Method Details

#apply(_http_request) ⇒ Object

Applies the authentication scheme on the given HTTP request.

Parameters:

  • _http_request (HttpRequest)

    The HTTP request to apply the authentication on.

Raises:

  • (NotImplementedError)


15
16
17
18
# File 'lib/apimatic-core-interfaces/types/authentication.rb', line 15

def apply(_http_request)
  raise NotImplementedError, 'This method needs
      to be implemented in a child class.'
end

#validBoolean

Checks whether this authentication scheme is valid or not.

Returns:

  • (Boolean)

    True if the auth instance is valid to be applied on the request.

Raises:

  • (NotImplementedError)


8
9
10
11
# File 'lib/apimatic-core-interfaces/types/authentication.rb', line 8

def valid
  raise NotImplementedError, 'This method needs
      to be implemented in a child class.'
end