Sha256: 91412b6c6b5dd90cc0eda2009ac675a082b17a1832d5b3b9a077fffe98bb98a4

Contents?: true

Size: 704 Bytes

Versions: 7

Compression:

Stored size: 704 Bytes

Contents

JS.Comparable = new JS.Module('Comparable', {
  extend: {
    ClassMethods: new JS.Module({
      compare: function(one, another) {
        return one.compareTo(another);
      }
    }),
    
    included: function(base) {
      base.extend(this.ClassMethods);
    }
  },
  
  lt: function(other) {
    return this.compareTo(other) < 0;
  },
  
  lte: function(other) {
    return this.compareTo(other) < 1;
  },
  
  gt: function(other) {
    return this.compareTo(other) > 0;
  },
  
  gte: function(other) {
    return this.compareTo(other) > -1;
  },
  
  eq: function(other) {
    return this.compareTo(other) === 0;
  },
  
  between: function(a, b) {
    return this.gte(a) && this.lte(b);
  }
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
spontaneous-0.1.0.alpha1 application/js/vendor/JS.Class-2.1.5/src/comparable.js
acts_as_dashboard-0.4.1 generators/dashboard/templates/js.class-2.1.4/src/comparable.js
acts_as_dashboard-0.4.0 generators/dashboard/templates/js.class-2.1.4/src/comparable.js
acts_as_dashboard-0.3.3 generators/dashboard/templates/js.class-2.1.4/src/comparable.js
acts_as_dashboard-0.3.2 generators/dashboard/templates/js.class-2.1.4/src/comparable.js
acts_as_dashboard-0.3.0 generators/dashboard/templates/js.class-2.1.4/src/comparable.js
acts_as_dashboard-0.1.0 generators/dashboard/templates/js.class-2.1.4/src/comparable.js