-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (35 loc) · 1.15 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
/**
* Module dependencies.
* @private
*/
var Events = require('./lib/event');
var Performance = require('./lib/performance');
var Availability = require('./lib/availability');
var Reserve = require('./lib/reserve');
var conf = require('./lib/config');
var configObjDefault = require('./config.json');
var Purchase = require('./lib/purchase');
var Status = require('./lib/status');
/**
* Module exports.
* @public
*/
module.exports = Ingresso;
function Ingresso(configObj) {
var config = conf.getInstance();
config.data = ((typeof configObj == 'object') &&
configObj.hasOwnProperty('user') &&
configObj.hasOwnProperty('password') &&
configObj.hasOwnProperty('url') ) ?
configObj :
configObjDefault;
if (!(this instanceof Ingresso))
return new Ingresso(configObj);
}
Ingresso.prototype.events = new Events();
Ingresso.prototype.performance = new Performance();
Ingresso.prototype.availability = new Availability();
Ingresso.prototype.reserve = new Reserve();
Ingresso.prototype.purchase = new Purchase();
Ingresso.prototype.status = new Status();