//
//  ModulesParser.swift
//  Jobz
//
//  Created by Amine on 5/20/18.
//  Copyright © 2018 Amine. All rights reserved.
//


import UIKit
import SwiftyJSON


class SyncAppConfigParser: Parser {
    
    
    func parse() -> [SyncAppConfig] {
        
        var list = [SyncAppConfig]()
    
        if let myResult = self.result {
                        
            
            if myResult.count > 0 {
                
                let size = myResult.count-1
                
                for index in 0...size {
                    
                    let object = myResult[String(index)]
                  
                    let myObject = SyncAppConfig()
                    
                    myObject.id = object["id"].intValue
                    myObject._key = object["_key"].stringValue
                    myObject._value = object["value"].stringValue
                    myObject._type = object["_type"].stringValue
                   
                    list.append(myObject)
                    
                }

                
            }
            
            
            return list
        }
        
        return []
    }
    
    
   
    
}



