Sha256: 61c0dc29a768d417526e9c5cd390578d56e876f292eb2b9157d48725fa81911c

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

module WeakSwaggerParameters
  module Definitions
    class ModelRef
      def initialize(model_class)
        @model_class = model_class
      end

      def apply_docs(parent_node)
        model_class = @model_class

        parent_node.instance_eval do
          schema do
            key :'$ref', model_class.docs_model_name
          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/model_ref.rb
weak_swagger_parameters-0.5.0 lib/weak_swagger_parameters/definitions/model_ref.rb