Class: A2A::SecurityScheme::APIKey
- Inherits:
-
Object
- Object
- A2A::SecurityScheme::APIKey
- Defined in:
- lib/a2a/security_scheme/api_key.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, location:, description: nil) ⇒ APIKey
constructor
A new instance of APIKey.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, location:, description: nil) ⇒ APIKey
Returns a new instance of APIKey.
8 9 10 11 12 |
# File 'lib/a2a/security_scheme/api_key.rb', line 8 def initialize(name:, location:, description: nil) @name = name @location = location @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/a2a/security_scheme/api_key.rb', line 6 def description @description end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/a2a/security_scheme/api_key.rb', line 6 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/a2a/security_scheme/api_key.rb', line 6 def name @name end |
Class Method Details
.from_h(hash) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/a2a/security_scheme/api_key.rb', line 14 def self.from_h(hash) new( name: hash.fetch("name"), location: hash.fetch("location"), description: hash["description"] ) end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/a2a/security_scheme/api_key.rb', line 22 def to_h { "apiKeySecurityScheme" => { "name" => name, "location" => location, "description" => description }.compact } end |