Skip to content

Commit fd87b69

Browse files
committed
GeolocationParams added
1 parent 7ab71b5 commit fd87b69

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

GeolocationParams.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
export class GeolocationParams {
22

3-
ip: string;
3+
ipAddress: string;
44
fields: string;
5-
ips: any;
5+
excludes: string;
6+
lang: string;
7+
ipAddresses: string[];
68

79
constructor() {
8-
this.ip = "";
9-
this.fields = "";
10-
this.ips = "";
10+
this.ipAddress = "";
11+
this.fields = "";
12+
this.excludes = "";
13+
this.lang = "en";
14+
this.ipAddresses = [];
1115
}
1216

13-
setIP(ip = "") {
14-
this.ip = ip;
17+
setIPAddress(ipAddress = "") {
18+
this.ipAddress = ipAddress;
1519
}
1620

17-
getIP() {
18-
return this.ip;
21+
getIPAddress() {
22+
return this.ipAddress;
1923
}
2024

2125
setFields(fields = "") {
@@ -26,15 +30,23 @@ export class GeolocationParams {
2630
return this.fields;
2731
}
2832

29-
setIPList(ips : any = null) {
30-
if(ips.length > 50) {
33+
setExcludes(excludes = "") {
34+
this.excludes = excludes;
35+
}
36+
37+
getExcludes() {
38+
return this.excludes;
39+
}
40+
41+
setIPAddresses(ipAddresses : string[] = []) {
42+
if(ipAddresses.length > 50) {
3143
console.log("Max. number of IP addresses cannot be more than 50.");
3244
} else {
33-
this.ips = ips;
45+
this.ipAddresses = ipAddresses;
3446
}
3547
}
3648

37-
getIPList() {
38-
return this.ips;
49+
getIPAddresses() {
50+
return this.ipAddresses;
3951
}
4052
}

0 commit comments

Comments
 (0)