Skip to content

Commit 88c2cd5

Browse files
Code re-structure
1 parent 214c5bb commit 88c2cd5

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

GeolocationParams.ts

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
export class GeolocationParams {
2+
ip: string;
3+
fields: string;
4+
ips: any;
5+
6+
constructor() {
7+
this.ip = "";
8+
this.fields = "";
9+
this.ips = "";
10+
}
211

3-
ip: string;
4-
fields: string;
5-
ips: any;
6-
7-
constructor() {
8-
this.ip = "";
9-
this.fields = "";
10-
this.ips = "";
11-
}
12+
setIp(ip = "") {
13+
this.ip = ip;
14+
}
1215

13-
setIp(ip = "") {
14-
this.ip = ip;
15-
}
16+
getIp() {
17+
return this.ip;
18+
}
1619

17-
getIp() {
18-
return this.ip;
19-
}
20+
setFields(fields = "") {
21+
this.fields = fields;
22+
}
2023

21-
setFields(fields = "") {
22-
this.fields = fields;
23-
}
24+
getFields() {
25+
return this.fields;
26+
}
2427

25-
getFields() {
26-
return this.fields;
27-
}
28+
setIps(ips : any = null) {
29+
if(ips.length > 50) {
30+
console.log("Max. number of IP addresses cannot be more than 50.");
31+
} else {
32+
this.ips = ips;
33+
}
34+
}
2835

29-
setIps(ips : any = null) {
30-
if(ips.length > 50) {
31-
console.log("Max. number of IP addresses cannot be more than 50.");
32-
} else {
33-
this.ips = ips;
34-
}
35-
}
36-
37-
getIps() {
38-
return this.ips;
39-
}
40-
}
36+
getIps() {
37+
return this.ips;
38+
}
39+
}

0 commit comments

Comments
 (0)