Class: Net::NATPMP::MappingResponse
- Defined in:
- lib/net/natpmp/responses.rb
Overview
Response for the mapping request
Instance Attribute Summary collapse
-
#inside_port ⇒ Object
readonly
Returns the value of attribute inside_port.
-
#lifetime ⇒ Object
readonly
Returns the value of attribute lifetime.
-
#outside_port ⇒ Object
readonly
Returns the value of attribute outside_port.
-
#proto ⇒ Object
readonly
Returns the value of attribute proto.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(response, proto:) ⇒ MappingResponse
constructor
A new instance of MappingResponse.
- #inspect ⇒ Object
Constructor Details
#initialize(response, proto:) ⇒ MappingResponse
Returns a new instance of MappingResponse.
40 41 42 43 44 45 |
# File 'lib/net/natpmp/responses.rb', line 40 def initialize(response, proto:) super @proto = proto @inside_port, @outside_port, @lifetime = response.unpack('@8nnN') end |
Instance Attribute Details
#inside_port ⇒ Object (readonly)
Returns the value of attribute inside_port.
38 39 40 |
# File 'lib/net/natpmp/responses.rb', line 38 def inside_port @inside_port end |
#lifetime ⇒ Object (readonly)
Returns the value of attribute lifetime.
38 39 40 |
# File 'lib/net/natpmp/responses.rb', line 38 def lifetime @lifetime end |
#outside_port ⇒ Object (readonly)
Returns the value of attribute outside_port.
38 39 40 |
# File 'lib/net/natpmp/responses.rb', line 38 def outside_port @outside_port end |
#proto ⇒ Object (readonly)
Returns the value of attribute proto.
38 39 40 |
# File 'lib/net/natpmp/responses.rb', line 38 def proto @proto end |
Instance Method Details
#inspect ⇒ Object
47 48 49 |
# File 'lib/net/natpmp/responses.rb', line 47 def inspect "Port mapping: #{@outside_port} -> #{@proto}:#{@inside_port} (lifetime: #{@lifetime})" end |