Sha256: a3968ca3097a4529e1f4a7e6a2896c93378ae80dad65c8239600b7712d249b40

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

module WeakSwaggerParameters
  module Definitions
    class Parameter
      include WeakSwaggerParameters::Definitions::LeafDefinition

      def initialize(location, type, name, description, options = {})
        @options = options.merge(location: location, type: type, name: name, description: description)
      end

      def apply_docs(parent_node)
        parameter_options = WeakSwaggerParameters::Services::SwaggerOptionsAdapter.adapt(@options)

        parent_node.instance_eval { parameter parameter_options }
      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/parameter.rb
weak_swagger_parameters-0.5.0 lib/weak_swagger_parameters/definitions/parameter.rb