Class: ImmosquareConstants::Ip::IpResult
- Inherits:
-
Object
- Object
- ImmosquareConstants::Ip::IpResult
- Defined in:
- lib/immosquare-constants/ip.rb
Overview
##
Simple class to provide dot notation access to IP addresses
##
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
Instance Method Summary collapse
-
#initialize(local_ip, client_ip) ⇒ IpResult
constructor
A new instance of IpResult.
- #inspect ⇒ Object
- #to_a ⇒ Object
- #to_h ⇒ Object
- #to_hash ⇒ Object
- #to_json ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(local_ip, client_ip) ⇒ IpResult
15 16 17 18 |
# File 'lib/immosquare-constants/ip.rb', line 15 def initialize(local_ip, client_ip) @local = local_ip @client = client_ip end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
13 14 15 |
# File 'lib/immosquare-constants/ip.rb', line 13 def client @client end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
13 14 15 |
# File 'lib/immosquare-constants/ip.rb', line 13 def local @local end |
Instance Method Details
#inspect ⇒ Object
38 39 40 |
# File 'lib/immosquare-constants/ip.rb', line 38 def inspect "#<ImmosquareConstants::Ip::IpResult local: #{@local.inspect}, client: #{@client.inspect}>" end |
#to_a ⇒ Object
42 43 44 |
# File 'lib/immosquare-constants/ip.rb', line 42 def to_a [@local, @client] end |
#to_h ⇒ Object
46 47 48 |
# File 'lib/immosquare-constants/ip.rb', line 46 def to_h to_hash end |
#to_hash ⇒ Object
27 28 29 30 31 32 |
# File 'lib/immosquare-constants/ip.rb', line 27 def to_hash { :local => @local, :client => @client } end |
#to_json ⇒ Object
20 21 22 23 24 25 |
# File 'lib/immosquare-constants/ip.rb', line 20 def to_json(*) { :local => @local, :client => @client }.to_json(*) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/immosquare-constants/ip.rb', line 34 def to_s "local: #{@local}, client: #{@client}" end |