transaction.js
function Transaction (attributes) {
  this.attributes = {}

  for (var key in attributes) {
    if (attributes.hasOwnProperty(key)) this.set(key, attributes[key])
  }

  if (!this.get('date')) this.setDate()
  if (!this.get('amount')) this.setAmount()
}
function Transaction (attributes) {
  this.attributes = {}

  for (var key in attributes) {
    if (attributes.hasOwnProperty(key)) this.set(key, attributes[key])
  }

  if (!this.get('date')) this.setDate()
  if (!this.get('amount')) this.setAmount()
}
function Transaction ( attributes ) { this . attributes = { } for ( var key in attributes ) { if ( attributes . hasOwnProperty ( key ) ) this . set ( key , attributes [ key ] ) } if ( ! this . get ( 'date' ) ) this . setDate ( ) if ( ! this . get ( 'amount' ) ) this . setAmount ( ) }
Represents a single transaction.
Getters and setters are used to transform and format values. Also responsible
for calculating amounts and dates when missing or invalid.
@constructor
@param {Object} attributes
Represents a single transaction . Getters and setters are used to transform and format values . Also responsible for calculating amounts and dates when missing or invalid .