Class: Jsapi::Meta::OpenAPI::Tag

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

Overview

Represents a tag 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

#descriptionObject

:attr: description The description of the tag.



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

attribute :description, String

#external_docsObject

:attr: external_docs The ExternalDocumentation object.



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

attribute :external_docs, ExternalDocumentation

#nameObject

:attr: name The name of the tag.



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

attribute :name, String

#to_openapiObject

Returns a hash representing the tag object.



24
25
26
27
28
29
30
# File 'lib/jsapi/meta/openapi/tag.rb', line 24

def to_openapi(*)
  {
    name: name,
    description: description,
    externalDocs: external_docs&.to_openapi
  }.compact
end