An open API service indexing awesome lists of open source software.

https://github.com/rmw-lib/at.property


https://github.com/rmw-lib/at.property

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

# Object.defineProperty for coffeescript

install

```
npm install at.property
```

use

```
require 'at.property'

class Person
constructor: (@firstName, @lastName) ->

@property(
name:
get: -> "#{@firstName} #{@lastName}"
set: (name) -> [@firstName, @lastName] = name.split ' '
)
```

code

```
Function::property = (dict) ->
for attr of dict
Object.defineProperty @::, attr, dict[attr]
```