Created
October 6, 2011 18:22
-
-
Save ColinCampbell/1268181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myRestrictedProp: function(key, value) { | |
myAllowedValues = ['here', 'there']; | |
if (value !== undefined) { | |
if (myAllowedValues.indexOf(value) === -1) { | |
throw "You tried to set a value that isn't allowed! " + value; | |
} else { | |
this._myRestrictedProp = value; | |
} | |
} | |
return this._myRestrictedProp; | |
}.property().cacheable() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment