aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/data/restriction.js
diff options
context:
space:
mode:
authorPierre Frisch2011-12-22 07:25:50 -0800
committerValerio Virgillito2012-01-27 11:18:17 -0800
commitb89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch)
tree0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /node_modules/montage/data/restriction.js
parent2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff)
downloadninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'node_modules/montage/data/restriction.js')
-rwxr-xr-xnode_modules/montage/data/restriction.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/node_modules/montage/data/restriction.js b/node_modules/montage/data/restriction.js
new file mode 100755
index 00000000..53c2f19d
--- /dev/null
+++ b/node_modules/montage/data/restriction.js
@@ -0,0 +1,66 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6/**
7 @module montage/data/restriction
8 @requires montage/core/core
9 @requires montage/core/logger
10*/
11var Montage = require("montage").Montage;
12// var Selector = require("data/selector").Selector;
13var logger = require("core/logger").logger("restrictions");
14/**
15 @class module:montage/data/restriction.Restriction
16 @extends module:montage/core/core.Montage
17*/
18var Restriction = exports.Restriction = Montage.create(Montage,/** @lends module:montage/data/restriction.Restriction# */ {
19/**
20 Description TODO
21 @type {Property}
22 @default {String} ""
23 */
24 name: {
25 serializable: true,
26 enumerable: true,
27 value: ""
28 },
29/**
30 Description TODO
31 @type {Property}
32 @default {String}{}
33 */
34 parameters: {
35 value: {},
36 serializable: true,
37 distinct: true,
38 enumerable: false,
39 writable: false
40 },
41/**
42 Description TODO
43 @function
44 @param {String} name To be initialized
45 @param {String} parameters To be initialized
46 @returns itself
47 */
48 initWithNameAndParameters: {
49 enumerable: false,
50 value: function(name, parameters) {
51 this.name = (name != null ? name : "default");
52 Object.defineProperty(this, "name", {writable: false});
53 if (parameters != null) {
54 var parametersNames = Object.getOwnPropertyNames(parameters);
55 var parameter, parameterName, index;
56 for (index = 0; typeof (parameterName = parametersNames[index]) !== "undefined"; index++) {
57 parameter = parameters[parameterName];
58 this.parameters[parameterName] = parameter;
59 }
60 }
61 Object.freeze(this.parameters);
62 return this;
63 }
64 }
65
66});