Class: OpenApi::Tag

Inherits:
Object
  • Object
show all
Includes:
EquatableAsContent
Defined in:
lib/open_api/tag.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EquatableAsContent

#==

Constructor Details

#initialize(name:, description: nil, external_docs: nil) ⇒ Tag

Returns a new instance of Tag.



8
9
10
11
12
# File 'lib/open_api/tag.rb', line 8

def initialize(name:, description: nil, external_docs: nil)
  self.name = name
  self.description = description
  self.external_docs = external_docs
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/open_api/tag.rb', line 6

def description
  @description
end

#external_docsObject

Returns the value of attribute external_docs.



6
7
8
# File 'lib/open_api/tag.rb', line 6

def external_docs
  @external_docs
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/open_api/tag.rb', line 6

def name
  @name
end

Class Method Details

.load(hash) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/open_api/tag.rb', line 14

def self.load(hash)
  return unless hash

  new(
    name: hash["name"].to_s,
    description: hash["description"]&.to_s,
    external_docs: ExternalDocumentation.load(hash["externalDocs"]),
  )
end