From a12e02c51bd00df71a8e282eac7d3446a6420551 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:52:11 -0500 Subject: [PATCH] Re-organization, no functional change --- src/activity-vocabulary.lisp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/activity-vocabulary.lisp b/src/activity-vocabulary.lisp index 6dae25e..3038cb2 100644 --- a/src/activity-vocabulary.lisp +++ b/src/activity-vocabulary.lisp @@ -119,15 +119,6 @@ CLASS’es slots with JSON keys based on the camel-cased slot name." tag to type updated url (@context :initform "https://www.w3.org/ns/activitystreams"))) -(defmethod yason:encode ((obj object) &optional (stream *standard-output*)) - (yason:with-output (stream) - (yason:with-object () - (yason:encode-object obj) - (yason:encode-object-element - "type" - (or (object-type obj) - (class-pretty-name (class-of obj))))))) - ;; https://www.w3.org/ns/activitystreams#Link (defclass-w-accessors link () (height href hreflang media-type name preview rel width)) @@ -214,6 +205,15 @@ CLASS’es slots with JSON keys based on the camel-cased slot name." ;;; JSON serialization ;;; ———————————————————————————————————————— +(defmethod yason:encode ((obj object) &optional (stream *standard-output*)) + (yason:with-output (stream) + (yason:with-object () + (yason:encode-object obj) + (yason:encode-object-element + "type" + (or (object-type obj) + (class-pretty-name (class-of obj))))))) + ;; Ensure all classes have their slots’ encodings defined with YASON. (mapcar (lambda (class) (closer-mop:finalize-inheritance class)