simplifying.

This commit is contained in:
Kevin G Christiano 2020-12-02 12:50:42 -05:00
parent 83d0786597
commit acebc936d7
2 changed files with 5 additions and 15 deletions

View File

@ -15,20 +15,14 @@ public protocol MoleculeModelProtocol: ModelProtocol {
public extension MoleculeModelProtocol { public extension MoleculeModelProtocol {
var moleculeName: String { var moleculeName: String { Self.identifier }
get { Self.identifier }
}
var accessibilityIdentifier: String? { var accessibilityIdentifier: String? {
get { nil } get { nil }
set { } set { }
} }
static var categoryName: String { static var categoryName: String { "\(MoleculeModelProtocol.self)" }
"\(MoleculeModelProtocol.self)"
}
static var categoryCodingKey: String { static var categoryCodingKey: String { "moleculeName" }
"moleculeName"
}
} }

View File

@ -31,15 +31,11 @@ public protocol RulesProtocol: ModelProtocol {
public extension RulesProtocol { public extension RulesProtocol {
var type: String { var type: String { Self.identifier }
get { Self.identifier }
}
static var categoryCodingKey: String { "type" } static var categoryCodingKey: String { "type" }
static var categoryName: String { static var categoryName: String { "\(RulesProtocol.self)" }
"\(RulesProtocol.self)"
}
// Individual rule can override the function to validate based on the rule type. // Individual rule can override the function to validate based on the rule type.
func validate(_ fieldMolecules: [String: FormFieldProtocol]) -> Bool { func validate(_ fieldMolecules: [String: FormFieldProtocol]) -> Bool {