old_contents: 'use strict';
  
  var exports = module.exports = {};
  
  var Response = exports.Response = function Response(channel) {
    this.channel = channel;
    this.data = '';
    this.sent = false;
  };
  
  Response.prototype.write = function write(data) {
    this.data += data;
  };
  
  Response.prototype.end = function end(data) {
    if (!this.sent) {
      this.data += (data || '');
      this.channel.send(this.data);
      this.sent = true;
    }
  };
  
new_contents: 'use strict';
  
  var exports = module.exports = {};
  
  class Response {
    constructor(channel) {
      this.channel = channel;
      this.data = '';
      this.sent = false;
    }
  
    write(data) {
      this.data += data;
    }
  
    end(data) {
      if (!this.sent && data) {
        this.data += data;
        this.channel.send(this.data);
        this.sent = true;
      }
    }
  }
  
  exports.response = Response;
  
subject: Convert response to ES6 class