Sha256: b881ba1057f0a1ee7ae9e2744cfcba16535d61e7dfbce375257a41a33ce174d0

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

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

        def apply_validations(parent_node)
          name = @name

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

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

          parent_node.instance_eval do
            parameter name: name, in: :path, required: true, description: description, type: :integer, format: :int32
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
weak_swagger_parameters-0.3.0 lib/weak_swagger_parameters/definitions/path_params/integer.rb