Created
February 4, 2014 13:04
-
-
Save Clokze/8803231 to your computer and use it in GitHub Desktop.
getter/setter
This file contains hidden or 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
| class Person | |
| get = (props) => @::__defineGetter__ name, getter for name, getter of props | |
| set = (props) => @::__defineSetter__ name, setter for name, setter of props | |
| # @property [String] The person name | |
| get name: -> @_name | |
| set name: (@_name) -> | |
| # The persons age | |
| get age: -> @_age |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment