Sha256: bea2d6c6bcdfa024118d76d2f8a99d15657f94867e3c720983c8af56c3b587a0

Contents?: true

Size: 641 Bytes

Versions: 2

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

module WeakSwaggerParameters
  module Definitions
    class CollectionProperty
      def initialize(name, description, model_class)
        @name = name
        @description = description
        @model_class = model_class
      end

      def apply_docs(parent_node)
        name = @name
        description = @description
        model_class = @model_class

        parent_node.instance_eval do
          property name, description: description, type: :array do
            items do
              key :'$ref', model_class.docs_model_name
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weak_swagger_parameters-0.6.0 lib/weak_swagger_parameters/definitions/collection_property.rb
weak_swagger_parameters-0.5.0 lib/weak_swagger_parameters/definitions/collection_property.rb