jsUtils

utils  0.2.4

jsUtils > utils > Utils.DataBean
Search:
 
Filters

Class Utils.DataBean

A simple value-object, with functions for property accessors and mutators. Mutator also fires a signal when the property changes.

Constructor

Utils.DataBean ( )

Methods

connect

void connect ( name , listener )
Connect to a properties slot.
Parameters:
name <String> the name of the property
listener <Function> the function to call when the signal is fired.
Returns: void

makeProp

void makeProp ( attribute )
Add a property to this object. After calling dataBean.makeProp('attribute'), the dataBean will have a new method dataBean.attribute(), this method when called with no-args acts as an accessor, and when called with args it acts like a mutator. The mutator will also fire a signal (with the name of the attribute) when the value changes.
Parameters:
attribute <String> the name of the attribute to create
Returns: void


Copyright © 2009 Gareth Andrew. All rights reserved.