// Generated by CoffeeScript 1.10.0
(function() {
  var Base, GiftCard, pluralize,
    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  Base = require('./base');

  pluralize = require('pluralize');

  GiftCard = (function(superClass) {
    extend(GiftCard, superClass);

    GiftCard.prototype.slug = 'gift_card';

    GiftCard.prototype.prefix = '/gift_cards';

    function GiftCard(site) {
      GiftCard.__super__.constructor.call(this, site);
    }

    GiftCard.prototype.disable = function(id, callback) {
      var url;
      url = this.resource.queryString(this.prefix + "/" + id + "/disable");
      return this.resource.post(url, this.slug, {
        id: id
      }, callback);
    };

    GiftCard.prototype.search = function(params, callback) {
      var ref, url;
      if (typeof params === 'function') {
        ref = [callback, params], params = ref[0], callback = ref[1];
      }
      url = this.resource.queryString(this.prefix + "/search", params);
      return this.resource.get(url, pluralize(this.slug), callback);
    };

    return GiftCard;

  })(Base);

  module.exports = GiftCard;

}).call(this);
