Permalink
Browse files

Move the ‘enum’ attribute into a separate file

  • Loading branch information...
1 parent 93f84a5 commit f0e9c13331c67a8b5f2aee6804328b3897b0c77a @Baggz committed Mar 9, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/engines/json/attributes/enum.js
@@ -0,0 +1,10 @@
+/**
+ * Enum
+ */
+Validation.prototype.addAttributeConstructor('enum', function enumConstructor() {
+
+ return function enum(property, propertyValue, attributeValue, propertyAttributes, callback) {
+ return (attributeValue.indexOf(propertyValue) === -1) ? callback(true) : callback();
+ };
+
+});

0 comments on commit f0e9c13

Please sign in to comment.