diff --git a/src/as2.lisp b/src/as2.lisp index 34a0a2f..fc13400 100644 --- a/src/as2.lisp +++ b/src/as2.lisp @@ -6,6 +6,7 @@ #:define-property-methods #:object #:link + #:as2-type #:attachment #:attributed-to #:audience @@ -61,7 +62,15 @@ (defmethod initialize-instance :after ((obj property-container) &key) (setf (gethash "type" (properties obj)) - (string-capitalize (class-name (class-of obj))))) + (kebab-camel (string-capitalize (class-name (class-of obj)))))) + +(defgeneric as2-type (property-container &optional value)) + +(defmethod as2-type ((obj property-container) &optional value) + (if value + (prog1 obj + (setf (gethash "type" (properties obj)) value)) + (gethash "type" (properties obj)))) (defmacro define-property-method (class-name name) `(defmethod ,name ((obj ,class-name) &optional value)