Class: CopyAi::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/copy_ai/authenticator.rb

Constant Summary collapse

AUTHENTICATION_HEADER =
"x-copy-ai-api-key".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:) ⇒ Authenticator

Returns a new instance of Authenticator.

[View source]

7
8
9
# File 'lib/copy_ai/authenticator.rb', line 7

def initialize(api_key:)
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.


5
6
7
# File 'lib/copy_ai/authenticator.rb', line 5

def api_key
  @api_key
end

Instance Method Details

#headerObject

[View source]

11
12
13
# File 'lib/copy_ai/authenticator.rb', line 11

def header
  {AUTHENTICATION_HEADER => api_key}
end