<commit_before>var Card = module.exports = function Card(options) {

  if(!(this instanceof Card)) {
    return new Card(options);
  }

  this.options = options;
};

Card.prototype.route = function route(req, res, category, path, callback) {
  res.writeHead(404, {
    'Content-Type': 'text/html'
  });
  res.end('Called the route method with path: ' + path);
};

Card.prototype.slug = function() {
  return this.slug || '';
};

Card.prototype.name = function() {
  return this.name || '';
};<commit_msg>call a route function from a router object if a match is found<commit_after>var Matcher = require('./matcher');

var Card = module.exports = function Card(options) {

  if(!(this instanceof Card)) {
    return new Card(options);
  }

  this.options = options;
  this.router = {};
};

Card.prototype.route = function route(req, res, category, path, callback) {
  var routes = this.router[req.method.toLowerCase()];

  Matcher(path, routes, function(err, obj) {
    if(err) return callback(err);
    obj.route.call(this, req, res, category, obj.params);
  });
};

Card.prototype.slug = function slug() {
  return this.slug || '';
};

Card.prototype.name = function name() {
  return this.name || '';
};
{'fraction_non_alphanumeric': 0.16362126245847175, 'fraction_numerical': 0.0024916943521594683, 'mean_word_length': 3.8785425101214575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5912851', 'n_tokens_mistral': 385, 'n_tokens_neox': 382, 'n_words': 99}