Separate action and molecule name

This commit is contained in:
panxi 2019-11-13 18:02:40 -05:00
parent 1a3d3eb36f
commit 478498a9b6

View File

@ -11,12 +11,15 @@ import Foundation
extension KeyedDecodingContainer where Key : CodingKey{
private enum TypeCodingKey: String, CodingKey {
case moleculeName
}
public func decode(codingKey: KeyedDecodingContainer<K>.Key) throws -> MoleculeProtocol {
return try decode(codingKey: codingKey, typeCodingKey: .moleculeName)
return try decode(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName)
}
public func decodeIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> MoleculeProtocol? {
return try decodeIfPresent(codingKey: codingKey, typeCodingKey: .moleculeName)
return try decodeIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName)
}
}