 
 public typealias JSON = [String : AnyObject]
 
-public protocol Glossy: Decodable {
+public protocol Glossy {
     
     /**
     Designated initializer to create new object

    
}

public protocol Decodable {
    
    /**
    Array of decoding functions
    */
    func decoders() -> [JSON -> ()]
    
}

public protocol Encodable {
    
    /**
    Array of encoded values as JSON
    */
    func encoders() -> [JSON?]
    
    /**
    JSON representation of object
    */
    func toJSON() -> JSON
}

public class Gloss : Glossy, Encodable {
    
    // MARK: - Initialization
    
    required public init(json: JSON) {
        applyDecoders(self.decoders())(json)
    }
    
    // MARK: - Protocol conformance
    
    // MARK: Decodable
    
    public func decoders() -> [JSON -> ()] {
        return []
    }
    
    // MARK: Encodable
    
    public func encoders() -> [JSON?] {
        return []
    }
    
    public func toJSON() -> JSON {
        var json: JSON = [:]
        
        for encoder in self.encoders() {
            if let encoder = encoder {
                json.add(encoder)
            }

        return json
    }
    
}
