Sha256: 10911ca14f9a7bc6e862abd99db82022ddaf13fa84a5c8c8b8632df8376ae79d

Contents?: true

Size: 804 Bytes

Versions: 3

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_object'
require_relative 'path_item_object'

module R2OAS
  module Schema
    module V3
      class TagObject < BaseObject
        def initialize(tags_data, opts = {})
          super(opts)
          @tags_data = tags_data
        end

        def to_doc
          @tags_data.each_with_object([]) do |tag_name, result|
            result.push(create_doc(tag_name))
          end
        end

        private

        def create_doc(tag_name)
          {
            'name' => tag_name,
            'description' => "#{tag_name} description",
            # External Docs Object
            'externalDocs' => {
              'description' => 'description',
              'url' => 'url'
            }
          }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
r2-oas-0.5.0 lib/r2-oas/schema/v3/object/from_routes/tag_object.rb
r2-oas-0.4.1 lib/r2-oas/schema/v3/object/from_routes/tag_object.rb
r2-oas-0.4.0 lib/r2-oas/schema/v3/object/from_routes/tag_object.rb