Class: Net::NATPMP::ExternalAddressResponse
- Defined in:
- lib/net/natpmp/responses.rb
Overview
Response for the external address request
Instance Attribute Summary collapse
-
#ip_int ⇒ Object
readonly
Returns the value of attribute ip_int.
Attributes inherited from Response
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(response) ⇒ ExternalAddressResponse
constructor
A new instance of ExternalAddressResponse.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ ExternalAddressResponse
Returns a new instance of ExternalAddressResponse.
18 19 20 21 |
# File 'lib/net/natpmp/responses.rb', line 18 def initialize(response) super @ip_int = response.unpack1('@8N') end |
Instance Attribute Details
#ip_int ⇒ Object (readonly)
Returns the value of attribute ip_int.
16 17 18 |
# File 'lib/net/natpmp/responses.rb', line 16 def ip_int @ip_int end |
Instance Method Details
#address ⇒ Object
23 24 25 |
# File 'lib/net/natpmp/responses.rb', line 23 def address IPAddr.new(ip_int, Socket::AF_INET) end |
#inspect ⇒ Object
31 32 33 |
# File 'lib/net/natpmp/responses.rb', line 31 def inspect "External address: #{address}" end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/net/natpmp/responses.rb', line 27 def to_s address.to_s end |