From 307a4c75339707edc234538e9dda86b8947abc8f Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 5 May 2024 15:01:01 +0200 Subject: [PATCH] Update script documentation --- src/classes/validationsingle.gd | 2 +- src/validation.gd | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/classes/validationsingle.gd b/src/classes/validationsingle.gd index 4787d06..49a4d0c 100644 --- a/src/classes/validationsingle.gd +++ b/src/classes/validationsingle.gd @@ -15,7 +15,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -## Validates some data against a set of rules. +## Validates some [param data] against a set of predefined rules. extends Node class_name CoreValidationSingle diff --git a/src/validation.gd b/src/validation.gd index ea50adf..dec2687 100644 --- a/src/validation.gd +++ b/src/validation.gd @@ -59,10 +59,12 @@ func _schedule() -> void: schema.queue_free() # +++ data validation +++ -func get_schema(schema: Dictionary, parent: Node) -> CoreValidationSchema: - schemas.append(parent) - return CoreValidationSchema.new(core, schema, parent) - +## Returns a new [CoreValidationSingle] func get_single(data, parent: Node) -> CoreValidationSingle: singles.append(parent) return CoreValidationSingle.new(core, data, parent) + +## Returns a new [CoreValidationSchema] +func get_schema(schema: Dictionary, parent: Node) -> CoreValidationSchema: + schemas.append(parent) + return CoreValidationSchema.new(core, schema, parent)