at.property

0.0.14 • Public • Published

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]

Readme

Keywords

none

Package Sidebar

Install

npm i at.property

Weekly Downloads

0

Version

0.0.14

License

MulanPSL-2.0

Unpacked Size

10.4 kB

Total Files

4

Last publish

Collaborators

  • gcxfd