Last active
December 25, 2015 23:22
-
-
Save alexiscreuzot/4fab911c64bb724d0934 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public var method: Alamofire.Method { | |
switch self { | |
case .Colors: | |
return Alamofire.Method.GET | |
case .AddColor: | |
return Alamofire.Method.POST | |
} | |
} | |
public var path: String { | |
switch self { | |
case .Colors, | |
case .AddColor: | |
return "/colors" | |
} | |
} | |
public var parameters: [String : AnyObject] { | |
switch self { | |
case .Colors(let search): | |
return ["format":"json", "search":search] | |
case .AddColor(let color): | |
return color.asDictionary() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment