Class: SwaggerPetstore::ApiKeyCredentials
- Inherits:
-
Object
- Object
- SwaggerPetstore::ApiKeyCredentials
- Defined in:
- lib/swagger_petstore/http/auth/api_key.rb
Overview
Data class for ApiKeyCredentials. Data class for ApiKeyCredentials.
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #clone_with(api_key: nil) ⇒ Object
-
#initialize(api_key:) ⇒ ApiKeyCredentials
constructor
A new instance of ApiKeyCredentials.
Constructor Details
#initialize(api_key:) ⇒ ApiKeyCredentials
Returns a new instance of ApiKeyCredentials.
30 31 32 33 34 |
# File 'lib/swagger_petstore/http/auth/api_key.rb', line 30 def initialize(api_key:) raise ArgumentError, 'api_key cannot be nil' if api_key.nil? @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
28 29 30 |
# File 'lib/swagger_petstore/http/auth/api_key.rb', line 28 def api_key @api_key end |
Instance Method Details
#clone_with(api_key: nil) ⇒ Object
36 37 38 39 40 |
# File 'lib/swagger_petstore/http/auth/api_key.rb', line 36 def clone_with(api_key: nil) api_key ||= self.api_key ApiKeyCredentials.new(api_key: api_key) end |