Last active
May 28, 2016 09:15
-
-
Save nunogoncalves/c528a516bf038e2446c8542e3f9c00bf 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
extension Users { | |
class Getter : Requestable { | |
var httpMethod = HTTPMethod.GET | |
var headers: HeadParams? = ["Authorization" : "Bearer \(CurrentUser.accessToken ?? "")"] | |
func fillHeaders() {} | |
var bodyParams: BodyParams? = [:] | |
func fillBodyParams() {} | |
var encoding = RequestEncoding.URL | |
var url = "https://..." | |
func getDataFrom(dictionary: NSDictionary) -> User { | |
return Deserialize.UserDeserializer().buildFrom(dictionary) | |
} | |
func get(success success: NSDictionary -> (), failure: ApiResponse -> ()) { | |
call(success: success, failure: failure) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment