Class: DryOpenApi::Info

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Includes:
EquatableAsContent
Defined in:
lib/dry_open_api/info.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EquatableAsContent

#==

Class Method Details

.load(hash) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/dry_open_api/info.rb', line 27

def self.load(hash)
  new(
    title: hash['title'],
    description: hash['description'],
    terms_of_service: hash['termsOfService'],
    contact: Contact.load(hash['contact']),
    license: License.load(hash['license']),
    version: hash['version']
  )
end

Instance Method Details

#serializable_hashObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/dry_open_api/info.rb', line 16

def serializable_hash
  {
    'title' => title,
    'description' => description,
    'termsOfService' => terms_of_service,
    'contact' => contact&.serializable_hash,
    'license' => license&.serializable_hash,
    'version' => version
  }.compact
end