Sha256: ee3af57543fde38e21b495fdab492ddfc314d33fd9a4c8d686e77a631ae3eb0d

Contents?: true

Size: 682 Bytes

Versions: 3

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true
module WeakSwaggerParameters
  module Definitions
    module PathParams
      class String
        def initialize(name, description)
          @name = name
          @description = description
        end

        def apply_validations(parent_node)
          name = @name

          parent_node.instance_eval do
            string name, strong: true
          end
        end

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

          parent_node.instance_eval do
            parameter name: name, type: :string, in: :path, description: description
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
weak_swagger_parameters-0.2.0 lib/weak_swagger_parameters/definitions/path_params/string.rb
weak_swagger_parameters-0.1.1 lib/weak_swagger_parameters/definitions/path_params/string.rb
weak_swagger_parameters-0.0.1 lib/weak_swagger_parameters/definitions/path_params/string.rb