Class: Jsapi::Meta::OpenAPI::Info

Inherits:
Base
  • Object
show all
Defined in:
lib/jsapi/meta/openapi/info.rb

Overview

Represents an info object.

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect, #reference?, #resolve

Methods included from Attributes::ClassMethods

#attribute, #attribute_names

Constructor Details

This class inherits a constructor from Jsapi::Meta::Base

Instance Method Details

#contactObject

:attr: contact The optional Contact object.



11
# File 'lib/jsapi/meta/openapi/info.rb', line 11

attribute :contact, Contact

#descriptionObject

:attr: description The optional description of the API.



16
# File 'lib/jsapi/meta/openapi/info.rb', line 16

attribute :description, String

#licenseObject

:attr: license The optional License object.



21
# File 'lib/jsapi/meta/openapi/info.rb', line 21

attribute :license, License

#terms_of_serviceObject

: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

#titleObject

:attr: title The title of the API.



31
# File 'lib/jsapi/meta/openapi/info.rb', line 31

attribute :title, String

#to_openapiObject

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

#versionObject

:attr: version The version of the API.



36
# File 'lib/jsapi/meta/openapi/info.rb', line 36

attribute :version, String