From 9996f5a84cd446c97dd38472ef160e2b28b661d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Tue, 29 Oct 2019 10:34:58 -0300 Subject: [PATCH] Method to get id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- lib/specs/spec_1.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/specs/spec_1.js b/lib/specs/spec_1.js index 4b3176a..4ab8e03 100644 --- a/lib/specs/spec_1.js +++ b/lib/specs/spec_1.js @@ -37,6 +37,33 @@ function Spec1(_caller) { * Used to inject compatibility methods or attributes */ this.caller = _caller; + + // dataschema attribute + this.caller.prototype.dataschema = function(dataschema){ + this.spec.dataschema(dataschema); + return this; + } + this.caller.prototype.getDataschema = function() { + return this.spec.getDataschema(); + } + + // datacontenttype attribute + this.caller.prototype.dataContentType = function(contentType){ + this.spec.dataContentType(contentType); + return this; + }; + this.caller.prototype.getDataContentType = function(){ + return this.spec.getDataContentType(); + }; + + // subject attribute + this.caller.prototype.subject = function(_subject){ + this.spec.subject(_subject); + return this; + }; + this.caller.prototype.getSubject = function(){ + return this.spec.getSubject(); + }; } Spec1.prototype.id = function(_id){ @@ -44,4 +71,8 @@ Spec1.prototype.id = function(_id){ return this; }; +Spec1.prototype.getId => { + return this.payload["id"]; +} + module.exports = Spec1;