Sha256: 0abea4903dcd9c538d642fdff989d6d712ae70b6cb95f0a69e23835d4c7ec1f1

Contents?: true

Size: 617 Bytes

Versions: 4

Compression:

Stored size: 617 Bytes

Contents

module ApiTaster
  class Mapper
    class << self
      def get(path, params = {})
        map_method(:get, path, params)
      end

      def post(path, params = {})
        map_method(:post, path, params)
      end

      def put(path, params = {})
        map_method(:put, path, params)
      end

      def delete(path, params = {})
        map_method(:delete, path, params)
      end

      private

      def map_method(method, path, params)
        route = Route.find_by_verb_and_path(method, path)

        Route.inputs[route[:id]] ||= []
        Route.inputs[route[:id]] << params
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
api_taster-0.2.2 lib/api_taster/mapper.rb
api_taster-0.2.1 lib/api_taster/mapper.rb
api_taster-0.2.0 lib/api_taster/mapper.rb
api_taster-0.1.0 lib/api_taster/mapper.rb