call for check
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
1f2841d5bd
commit
7d6a1e51f9
|
|
@ -16,6 +16,10 @@ function Cloudevent(_spec, _formatter){
|
|||
* To format the payload using the formatter
|
||||
*/
|
||||
Cloudevent.prototype.format = function(){
|
||||
// Check the constraints
|
||||
this.spec.check();
|
||||
|
||||
// Then, format
|
||||
return this.formatter.format(this.spec.payload);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,13 @@ function Spec_0_2(){
|
|||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the spec constraints.
|
||||
*/
|
||||
Spec_0_2.prototype.check = function(){
|
||||
|
||||
}
|
||||
|
||||
Spec_0_2.prototype.type = function(_type){
|
||||
this.payload['type'] = _type;
|
||||
return this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue