Sha256: 154dd41e5800f1cf5a897de898f3108ebc6fbf61d3f5f0eefc03fb6443fcda15
Contents?: true
Size: 942 Bytes
Versions: 10
Compression:
Stored size: 942 Bytes
Contents
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 } [ :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
10 entries across 10 versions & 1 rubygems