Class: WordsApi::CustomHeaderAuthenticationCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/words_api/http/auth/custom_header_authentication.rb

Overview

Data class for CustomHeaderAuthenticationCredentials. Data class for CustomHeaderAuthenticationCredentials.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x_rapid_api_key:) ⇒ CustomHeaderAuthenticationCredentials

Returns a new instance of CustomHeaderAuthenticationCredentials.

Raises:

  • (ArgumentError)


30
31
32
33
34
# File 'lib/words_api/http/auth/custom_header_authentication.rb', line 30

def initialize(x_rapid_api_key:)
  raise ArgumentError, 'x_rapid_api_key cannot be nil' if x_rapid_api_key.nil?

  @x_rapid_api_key = x_rapid_api_key
end

Instance Attribute Details

#x_rapid_api_keyObject (readonly)

Returns the value of attribute x_rapid_api_key.



28
29
30
# File 'lib/words_api/http/auth/custom_header_authentication.rb', line 28

def x_rapid_api_key
  @x_rapid_api_key
end

Instance Method Details

#clone_with(x_rapid_api_key: nil) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/words_api/http/auth/custom_header_authentication.rb', line 36

def clone_with(x_rapid_api_key: nil)
  x_rapid_api_key ||= self.x_rapid_api_key

  CustomHeaderAuthenticationCredentials.new(
    x_rapid_api_key: x_rapid_api_key
  )
end