immosquare-constants 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/immosquare-constants/ip.rb +10 -6
- data/lib/immosquare-constants/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b0e58e67146383f7bb046bc321ac80ae421919e732b8ef6e601db0921a952a3
|
4
|
+
data.tar.gz: 86dcdc2878e7ab49df7f3b51741b2061b7114d8256d3bd362bb03084b20ec940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77cb31bd52a176a82bb5909f42e5d45068f6baefdb1f691cbaf147091d53ddbdb17eedfaa086e1d3d026ea59362a81563a70059599045f93012d0c529b174038
|
7
|
+
data.tar.gz: 138cf03ab85646ff1c7bea7498c04897f566933bb515e44f731404cd1d69baaded686171e4715b911fa5b4432ae3b406adac1412476bd8cb5b9233f088161020
|
@@ -10,16 +10,18 @@ module ImmosquareConstants
|
|
10
10
|
##============================================================##
|
11
11
|
class IpResult
|
12
12
|
|
13
|
-
attr_reader :local, :client
|
13
|
+
attr_reader :local, :public, :client
|
14
14
|
|
15
|
-
def initialize(local_ip, client_ip)
|
16
|
-
@local
|
15
|
+
def initialize(local_ip, public_ip, client_ip)
|
16
|
+
@local = local_ip
|
17
|
+
@public = public_ip
|
17
18
|
@client = client_ip
|
18
19
|
end
|
19
20
|
|
20
21
|
def to_json(*)
|
21
22
|
{
|
22
23
|
:local => @local,
|
24
|
+
:public => @public,
|
23
25
|
:client => @client
|
24
26
|
}.to_json(*)
|
25
27
|
end
|
@@ -27,20 +29,21 @@ module ImmosquareConstants
|
|
27
29
|
def to_hash
|
28
30
|
{
|
29
31
|
:local => @local,
|
32
|
+
:public => @public,
|
30
33
|
:client => @client
|
31
34
|
}
|
32
35
|
end
|
33
36
|
|
34
37
|
def to_s
|
35
|
-
"local: #{@local}, client: #{@client}"
|
38
|
+
"local: #{@local}, public: #{@public}, client: #{@client}"
|
36
39
|
end
|
37
40
|
|
38
41
|
def inspect
|
39
|
-
"#<ImmosquareConstants::Ip::IpResult local: #{@local.inspect}, client: #{@client.inspect}>"
|
42
|
+
"#<ImmosquareConstants::Ip::IpResult local: #{@local.inspect}, public: #{@public.inspect}, client: #{@client.inspect}>"
|
40
43
|
end
|
41
44
|
|
42
45
|
def to_a
|
43
|
-
[@local, @client]
|
46
|
+
[@local, @public, @client]
|
44
47
|
end
|
45
48
|
|
46
49
|
def to_h
|
@@ -64,6 +67,7 @@ module ImmosquareConstants
|
|
64
67
|
def get_ips(request = nil)
|
65
68
|
IpResult.new(
|
66
69
|
get_local_ip,
|
70
|
+
get_public_ip_from_aws,
|
67
71
|
get_client_ip(request)
|
68
72
|
)
|
69
73
|
end
|