Class: Jsapi::Meta::Info
- Inherits:
-
Jsapi::Model::Base
- Object
- Jsapi::Model::Base
- Jsapi::Meta::Info
- Includes:
- OpenAPI::Extensions
- Defined in:
- lib/jsapi/meta/info.rb
Overview
Specifies metadata about an API.
Instance Method Summary collapse
-
#contact ⇒ Object
:attr: contact The Contact.
-
#description ⇒ Object
:attr: description The description of the API.
-
#license ⇒ Object
:attr: license The License.
-
#summary ⇒ Object
:attr: summary The short summary of the API.
-
#terms_of_service ⇒ Object
:attr: terms_of_service The URL pointing to the terms of service.
-
#title ⇒ Object
:attr: title The title of the API.
-
#to_openapi(version) ⇒ Object
Returns a hash representing the OpenAPI info object.
-
#version ⇒ Object
:attr: version The version of the API.
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
#contact ⇒ Object
:attr: contact The Contact.
12 |
# File 'lib/jsapi/meta/info.rb', line 12 attribute :contact, Contact |
#description ⇒ Object
:attr: description The description of the API.
17 |
# File 'lib/jsapi/meta/info.rb', line 17 attribute :description, String |
#license ⇒ Object
:attr: license The License.
22 |
# File 'lib/jsapi/meta/info.rb', line 22 attribute :license, License |
#summary ⇒ Object
:attr: summary The short summary of the API. Applies to OpenAPI 3.1 and higher.
27 |
# File 'lib/jsapi/meta/info.rb', line 27 attribute :summary, String |
#terms_of_service ⇒ Object
:attr: terms_of_service The URL pointing to the terms of service.
32 |
# File 'lib/jsapi/meta/info.rb', line 32 attribute :terms_of_service, String |
#title ⇒ Object
:attr: title The title of the API.
37 |
# File 'lib/jsapi/meta/info.rb', line 37 attribute :title, String |
#to_openapi(version) ⇒ Object
Returns a hash representing the OpenAPI info object.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/jsapi/meta/info.rb', line 45 def to_openapi(version, *) version = OpenAPI::Version.from(version) with_openapi_extensions( title: title, summary: (summary if version >= OpenAPI::V3_1), description: description, termsOfService: terms_of_service, contact: contact&.to_openapi, license: license&.to_openapi(version), version: self.version ) end |
#version ⇒ Object
:attr: version The version of the API.
42 |
# File 'lib/jsapi/meta/info.rb', line 42 attribute :version, String |