2014-03-05 11:11:16 -08:00
|
|
|
'use strict';
|
|
|
|
var imports = require('soop').imports();
|
|
|
|
var parent = imports.parent || require('./util/VersionedData');
|
2013-07-07 11:02:00 -07:00
|
|
|
|
2014-03-05 11:11:16 -08:00
|
|
|
function Address() {
|
|
|
|
Address.super(this, arguments);
|
|
|
|
}
|
2013-07-07 11:02:00 -07:00
|
|
|
|
2014-03-05 11:11:16 -08:00
|
|
|
Address.parent = parent;
|
|
|
|
parent.applyEncodingsTo(Address);
|
2013-07-07 11:02:00 -07:00
|
|
|
|
2014-03-05 11:11:16 -08:00
|
|
|
Address.prototype.validate = function() {
|
2014-03-11 06:21:26 -07:00
|
|
|
var answer;
|
2014-03-05 11:11:16 -08:00
|
|
|
this.doAsBinary(function() {
|
|
|
|
Address.super(this, 'validate', arguments);
|
2014-03-11 06:21:26 -07:00
|
|
|
answer = (this.data.length === 21);
|
2014-03-05 11:11:16 -08:00
|
|
|
});
|
2014-03-11 06:21:26 -07:00
|
|
|
return answer;
|
2014-03-05 11:11:16 -08:00
|
|
|
};
|
2013-07-07 11:02:00 -07:00
|
|
|
|
2014-03-05 11:11:16 -08:00
|
|
|
module.exports = require('soop')(Address);
|