Separate action and molecule name
This commit is contained in:
parent
1a3d3eb36f
commit
478498a9b6
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user