Skip to content

Instantly share code, notes, and snippets.

@chibenwa
Created July 2, 2019 04:26
Show Gist options
  • Save chibenwa/6d73cb74525348ec58356453462fe830 to your computer and use it in GitHub Desktop.
Save chibenwa/6d73cb74525348ec58356453462fe830 to your computer and use it in GitHub Desktop.
export default class BodyBuilder {
constructor() {
this.result = [];
}
appendGetMessageList(options, name = '#0') {
this.append('getMessageList', options, name);
return this;
}
appendGetMessages(options, name = '#0') {
this.append('getMessages', options, name);
return this;
}
append(method, options, name) {
this.result.push([method, options, name]);
}
getBody() {
return this.result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment