Class: Modern::Descriptor::Security::ApiKey

Inherits:
Base
  • Object
show all
Defined in:
lib/modern/descriptor/security.rb

Instance Method Summary collapse

Methods inherited from Base

#validate

Methods included from Struct::Copy

#copy

Constructor Details

#initialize(fields) ⇒ ApiKey

Returns a new instance of ApiKey.



57
58
59
60
61
62
63
# File 'lib/modern/descriptor/security.rb', line 57

def initialize(fields)
  super

  # I didn't want to rewrite all my parameter logic.
  raise Modern::Errors::SetupError, "Parameter must not be 'required' (internal limitation)." \
    if parameter.required
end

Instance Method Details

#do_credential_fetch(request) ⇒ Object



65
66
67
# File 'lib/modern/descriptor/security.rb', line 65

def do_credential_fetch(request)
  parameter.do_retrieve(request)
end

#to_openapi3Object



69
70
71
# File 'lib/modern/descriptor/security.rb', line 69

def to_openapi3
  parameter.to_openapi3(true).merge(type: "apiKey")
end