Permalink
Browse files

Add a compatibility layer

  • Loading branch information...
1 parent dd51353 commit 58da343d6a803a9c8b6435a696d91455905cc6bf @Baggz committed Mar 14, 2012
Showing with 40 additions and 0 deletions.
  1. +40 −0 src/amanda.js
View
@@ -6,4 +6,44 @@ var Amanda = function(engine) {
return engines[engine];
+};
+
+/**
+ * Amanda.validate
+ *
+ * This method is deprecated, please use ‘amanda('json').validate’ instead.
+ */
+Amanda.validate = function(instance, schema, options, callback) {
+ var json = engines.json;
+ return json.validate.apply(json, arguments);
+};
+
+/**
+ * Amanda.addValidator
+ *
+ * This method is deprecated, please use ‘amanda('json').addValidator’ instead.
+ */
+Amanda.addValidator = function(attributeName, attributeFn) {
+ var json = engines.json;
+ return json.addAttribute.apply(json, arguments);
+};
+
+/**
+ * Amanda.addAttribute
+ *
+ * This method is deprecated, please use ‘amanda('json').addAttribute’ instead.
+ */
+Amanda.addAttribute = function(attributeName, attributeFn) {
+ var json = engines.json;
+ return json.addAttribute.apply(json, arguments);
+};
+
+/**
+ * Amanda.addAttributeConstructor
+ *
+ * This method is deprecated, please use ‘amanda('json').addAttributeConstructor’ instead.
+ */
+Amanda.addAttributeConstructor = function(attributeName, attributeConstructor) {
+ var json = engines.json;
+ return json.addAttributeConstructor.apply(json, arguments);
};

0 comments on commit 58da343

Please sign in to comment.