immosquare-constants 0.1.13 → 0.1.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5073fe427e2b2b4c43e1152815e581dd34e1ad8b212c0fb5331a3d9b17c95c28
4
- data.tar.gz: 774752277082db562cf31143d55e5df66456148dc261ad820bf4ea25b16a3fd2
3
+ metadata.gz: e8b740c638cc553f9e3a1bd674d3bf270cfda3832c83552fe1338a26655e14eb
4
+ data.tar.gz: 87870755a5c2c463ffb7ff8741ef29ed12d770cada0b5a5a334408ab7d0dd988
5
5
  SHA512:
6
- metadata.gz: 0dfa8a292ab75f8ed0f5b18f7360fb6b93eded2aaf2dd9ad01d308e5bcecd8b9ddf7c1f645c702a5310376ae31ec5a82a72808c2d35fe08f97f2c0839e36fc87
7
- data.tar.gz: 685f991fa70989e6560332590d1d9309ca5b1df1e099751ccb0ec5a76514bbd4c0103b3ad60add4b736249d2db7ce84af60a8890d22d25dd883c77f7092b7573
6
+ metadata.gz: d62cda99d9972a6649a0153145fbd41b704d7d98a4c8cba01ac131979ffa229ca8bee91887f9f87a5e34883fc913a539631a12bb3d01b946ac1de639ac51393c
7
+ data.tar.gz: fc4e75e4f540c793235e2c10c2d52da9dcdea2e37cfef10274b723c8a183daa49f384f7efeff4d6ac402c143dd82bfa359057d268cda2b2f7e059e8888ebd04e
@@ -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 = local_ip
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,26 +29,35 @@ 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
47
50
  to_hash
48
51
  end
49
52
 
53
+ def each(&)
54
+ to_hash.each(&)
55
+ end
56
+
57
+ def each_with_index(&)
58
+ to_hash.each_with_index(&)
59
+ end
60
+
50
61
  end
51
62
 
52
63
  class << self
@@ -64,6 +75,7 @@ module ImmosquareConstants
64
75
  def get_ips(request = nil)
65
76
  IpResult.new(
66
77
  get_local_ip,
78
+ get_public_ip_from_aws,
67
79
  get_client_ip(request)
68
80
  )
69
81
  end
@@ -1,3 +1,3 @@
1
1
  module ImmosquareConstants
2
- VERSION = "0.1.13".freeze
2
+ VERSION = "0.1.15".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-constants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - immosquare