Class: Jsapi::Meta::Server
- Inherits:
-
Jsapi::Model::Base
- Object
- Jsapi::Model::Base
- Jsapi::Meta::Server
- Includes:
- OpenAPI::Extensions
- Defined in:
- lib/jsapi/meta/server.rb
Overview
Specifies a server.
Instance Method Summary collapse
-
#description ⇒ Object
:attr: description The description of the server.
-
#name ⇒ Object
:attr: name The optional unique name of the server.
-
#to_openapi(version) ⇒ Object
Returns a hash representing the OpenAPI server object.
-
#url ⇒ Object
:attr: url The absolute or relative URL of the server.
-
#variables ⇒ Object
:attr_reader: variables The ServerVariable objects.
Methods included from OpenAPI::Extensions
Methods inherited from Jsapi::Model::Base
#==, #errors, #initialize, #inspect, model_name, #respond_to_missing?
Constructor Details
This class inherits a constructor from Jsapi::Model::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Jsapi::Model::Base
Instance Method Details
#description ⇒ Object
:attr: description The description of the server.
12 |
# File 'lib/jsapi/meta/server.rb', line 12 attribute :description, String |
#name ⇒ Object
:attr: name The optional unique name of the server. Applies to OpenAPI 3.2 and higher.
17 |
# File 'lib/jsapi/meta/server.rb', line 17 attribute :name, String |
#to_openapi(version) ⇒ Object
Returns a hash representing the OpenAPI server object.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/jsapi/meta/server.rb', line 30 def to_openapi(version, *) version = OpenAPI::Version.from(version) with_openapi_extensions( url: url, description: description, name: (name if version >= OpenAPI::V3_2), variables: variables.transform_values(&:to_openapi).presence ) end |
#url ⇒ Object
:attr: url The absolute or relative URL of the server.
22 |
# File 'lib/jsapi/meta/server.rb', line 22 attribute :url, String |
#variables ⇒ Object
:attr_reader: variables The ServerVariable objects.
27 |
# File 'lib/jsapi/meta/server.rb', line 27 attribute :variables, { String => ServerVariable } |