Class: Jsapi::Meta::Info

Inherits:
Base::Model show all
Includes:
OpenAPI::Extensions
Defined in:
lib/jsapi/meta/info.rb

Overview

Specifies an info object.

Constant Summary

Constants included from Base::Attributes

Base::Attributes::DEFAULT_ARRAY, Base::Attributes::DEFAULT_HASH

Instance Method Summary collapse

Methods included from OpenAPI::Extensions

#add_openapi_extension, #openapi_extensions, #openapi_extensions=

Methods inherited from Base::Model

#initialize, #inspect, #merge!, #reference?, #resolve

Methods included from Base::Attributes

#attribute, #attribute_names

Constructor Details

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

Instance Method Details

#contactObject

:attr: contact The Contact object.



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

attribute :contact, Contact

#descriptionObject

:attr: description The description of the API.



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

attribute :description, String

#licenseObject

:attr: license The License object.



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

attribute :license, License

#terms_of_serviceObject

:attr: terms_of_service The URL pointing to the terms of service.



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

attribute :terms_of_service, String

#titleObject

:attr: title The title of the API.



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

attribute :title, String

#to_openapiObject

Returns a hash representing the OpenAPI info object.



40
41
42
43
44
45
46
47
48
49
# File 'lib/jsapi/meta/info.rb', line 40

def to_openapi(*)
  with_openapi_extensions(
    title: title,
    version: version,
    description: description,
    termsOfService: terms_of_service,
    contact: contact&.to_openapi,
    license: license&.to_openapi
  )
end

#versionObject

:attr: version The version of the API.



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

attribute :version, String