File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ String Cloudevent.toString()
7070
7171```
7272
73- ## ` Formatter ` class
73+ ## ` Formatter ` classes
74+
75+ Every formatter class must implement these methods to work properly.
7476
7577``` js
7678
@@ -86,6 +88,19 @@ String Formatter.toString(payload)
8688
8789```
8890
91+ ## ` Spec ` classes
92+
93+ Every Spec class must implement these methods to work properly.
94+
95+ ``` js
96+
97+ /*
98+ * Check the spec constraints, throwing an error if do not pass.
99+ */
100+ Spec .check ()
101+
102+ ```
103+
89104# How to use
90105
91106The ` Cloudevent ` constructor arguments.
Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ function Spec_0_1(_caller){
1919 }
2020}
2121
22+ /*
23+ * Check the constraints.
24+ *
25+ * throw an error if do not pass.
26+ */
27+ Spec_0_1 . prototype . check = function ( ) {
28+
29+ }
30+
2231Spec_0_1 . prototype . type = function ( _type ) {
2332 this . payload [ 'eventType' ] = _type ;
2433 return this ;
You can’t perform that action at this time.
0 commit comments