2018-09-11 14:52:21 +00:00
|
|
|
//
|
|
|
|
// Method.swift
|
|
|
|
// Pachyderm
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 9/8/18.
|
|
|
|
// Copyright © 2018 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
2022-03-30 02:21:33 +00:00
|
|
|
public enum Method {
|
2018-09-11 14:52:21 +00:00
|
|
|
case get, post, put, patch, delete
|
|
|
|
}
|
|
|
|
|
|
|
|
extension Method {
|
2022-03-30 02:21:33 +00:00
|
|
|
public var name: String {
|
2018-09-11 14:52:21 +00:00
|
|
|
switch self {
|
|
|
|
case .get:
|
|
|
|
return "GET"
|
|
|
|
case .post:
|
|
|
|
return "POST"
|
|
|
|
case .put:
|
|
|
|
return "PUT"
|
|
|
|
case .patch:
|
|
|
|
return "PATCH"
|
|
|
|
case .delete:
|
|
|
|
return "DELETE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|