simplifying.
This commit is contained in:
parent
83d0786597
commit
acebc936d7
@ -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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user