Sha256: d80519fe98123f207f03917c3968ab9791f56a2bd4cd23ebe17d091e7f1ff401
Contents?: true
Size: 965 Bytes
Versions: 23
Compression:
Stored size: 965 Bytes
Contents
# frozen_string_literal: true module Praxis module Docs module OpenApi class InfoObject attr_reader :info, :version def initialize(version:, api_definition_info:) @version = version @info = api_definition_info raise "OpenApi docs require a 'Title' for your API." unless info.title end def dump data = { version: version } %i[ title description termsOfService contact license ].each do |attr| val = info.send(attr) data[attr] = val if val end # Special attributes data[:'x-name'] = info.name if info.logo_url data[:'x-logo'] = { url: info.logo_url, backgroundColor: '#FFFFFF', altText: info.title } end data end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems