Class: Jsapi::Meta::OpenAPI::Info
- Defined in:
- lib/jsapi/meta/openapi/info.rb
Overview
Represents an info object.
Instance Method Summary collapse
-
#contact ⇒ Object
:attr: contact The optional Contact object.
-
#description ⇒ Object
:attr: description The optional description of the API.
-
#license ⇒ Object
:attr: license The optional License object.
-
#terms_of_service ⇒ Object
:attr: terms_of_service The optional URL pointing to the terms of service.
-
#title ⇒ Object
:attr: title The title of the API.
-
#to_openapi ⇒ Object
Returns a hash representing the info object.
-
#version ⇒ Object
:attr: version The version of the API.
Methods inherited from Base
#initialize, #inspect, #reference?, #resolve
Methods included from Attributes::ClassMethods
Constructor Details
This class inherits a constructor from Jsapi::Meta::Base
Instance Method Details
#contact ⇒ Object
:attr: contact The optional Contact object.
11 |
# File 'lib/jsapi/meta/openapi/info.rb', line 11 attribute :contact, Contact |
#description ⇒ Object
:attr: description The optional description of the API.
16 |
# File 'lib/jsapi/meta/openapi/info.rb', line 16 attribute :description, String |
#license ⇒ Object
:attr: license The optional License object.
21 |
# File 'lib/jsapi/meta/openapi/info.rb', line 21 attribute :license, License |
#terms_of_service ⇒ Object
:attr: terms_of_service The optional URL pointing to the terms of service.
26 |
# File 'lib/jsapi/meta/openapi/info.rb', line 26 attribute :terms_of_service, String |
#title ⇒ Object
:attr: title The title of the API.
31 |
# File 'lib/jsapi/meta/openapi/info.rb', line 31 attribute :title, String |
#to_openapi ⇒ Object
Returns a hash representing the info object.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/jsapi/meta/openapi/info.rb', line 39 def to_openapi(*) { title: title, version: version, description: description, termsOfService: terms_of_service, contact: contact&.to_openapi, license: license&.to_openapi }.compact end |
#version ⇒ Object
:attr: version The version of the API.
36 |
# File 'lib/jsapi/meta/openapi/info.rb', line 36 attribute :version, String |