Sha256: cd114abf36ff83508ae9cda31406c9744b0f5ead01f971eef592b532f8deba98

Contents?: true

Size: 470 Bytes

Versions: 2

Compression:

Stored size: 470 Bytes

Contents

# frozen_string_literal: true
module WeakSwaggerParameters
  module Definitions
    class CollectionRef
      def initialize(model_class)
        @model_class = model_class
      end

      def apply_docs(parent_node)
        model_class = @model_class

        parent_node.instance_eval do
          schema 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.4.0 lib/weak_swagger_parameters/definitions/collection_ref.rb
weak_swagger_parameters-0.3.0 lib/weak_swagger_parameters/definitions/collection_ref.rb