Class: SvcbRrPatch::SvcParams::Port
- Inherits:
-
Object
- Object
- SvcbRrPatch::SvcParams::Port
- Defined in:
- lib/svcb_rr_patch/svc_params/port.rb
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Class Method Summary collapse
-
.decode(octet) ⇒ Object
:nodoc:.
Instance Method Summary collapse
- #encode ⇒ String
-
#initialize(port) ⇒ Port
constructor
A new instance of Port.
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(port) ⇒ Port
Returns a new instance of Port.
7 8 9 |
# File 'lib/svcb_rr_patch/svc_params/port.rb', line 7 def initialize(port) @port = port end |
Instance Attribute Details
#port ⇒ Object (readonly)
Returns the value of attribute port.
4 5 6 |
# File 'lib/svcb_rr_patch/svc_params/port.rb', line 4 def port @port end |
Class Method Details
.decode(octet) ⇒ Object
:nodoc:
17 18 19 20 |
# File 'lib/svcb_rr_patch/svc_params/port.rb', line 17 def self.decode(octet) port = octet.unpack1('n') new(port) end |
Instance Method Details
#encode ⇒ String
12 13 14 |
# File 'lib/svcb_rr_patch/svc_params/port.rb', line 12 def encode [@port].pack('n') end |
#to_s ⇒ Object
:nodoc:
23 24 25 |
# File 'lib/svcb_rr_patch/svc_params/port.rb', line 23 def to_s @port.to_s end |