Skip to content

Instantly share code, notes, and snippets.

Created November 21, 2016 10:32
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Organisation getter
extension GitKit {
public class func getMyOrganisations() -> Observable<[Organisation]> {
guard let organisationsURL = GitKit.currentUser.value?.organizationsUrl else { return [] }
return Alamofire.request(.GET, (organisationsURL))
.map { response, json in
guard let array = json as? [[String:AnyObject]] else { return [] }
return { [unowned self] json in
return Organisation(json: array)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment