Failed Conditions
Pull Request — master (#2)
by Yo
01:30
created

lib/model/Request.js   A

Size

Lines of Code 80

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 8.75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
nc 1
dl 0
loc 80
rs 10
ccs 7
cts 80
cp 0.0875
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A Request.js ➔ ??? 0 9 1
1
"use strict";
2
3
class Request {
4
    /**
5
     * @param {string}  uri
6
     * @param {string}  method
7
     * @param {Object}  payload
8
     * @param {Object}  queryString
9
     * @param {Object}  headers
10
     * @param {Object}  form
11
     * @param {boolean} json
12
     */
13
    constructor(uri, method = 'GET', payload = {}, queryString = {}, headers = {}, form = {}, json = true) {
14
        this.uri = uri;
15 10
        this.method = method;
16 10
        this.payload = payload;
17 10
        this.queryString = queryString;
18 10
        this.headers = headers;
19 10
        this.form = form;
20 10
        this.json = json;
21
    }
22
23
    /**
24
     * @public
25
     * @returns {string}
26
     */
27
    getUri() {
28
        return this.uri;
29
    }
30
31
    /**
32
     * @public
33
     * @returns {Object}
34
     */
35
    getPayload() {
36
        return this.payload;
37
    }
38
39
    /**
40
     * @public
41
     * @returns {Object}
42
     */
43
    getQueryString() {
44
        return this.queryString;
45
    }
46
47
    /**
48
     * @public
49
     * @returns {Object}
50
     */
51
    getHeaders() {
52
        return this.headers;
53
    }
54
55
    /**
56
     * @public
57
     * @returns {string}
58
     */
59
    getMethod() {
60
        return this.method;
61
    }
62
63
    /**
64
     * @public
65
     * @returns {Object}
66
     */
67
    getForm() {
68
        return this.form;
69
    }
70
71
    /**
72
     * @public
73
     * @returns {boolean}
74
     */
75
    isJson() {
76
        return this.json;
77
    }
78
}
79
80
module.exports = Request;
81