Class: LibSL::LLIPPort
- Inherits:
-
Object
- Object
- LibSL::LLIPPort
- Defined in:
- lib/types.rb
Instance Attribute Summary collapse
-
#port ⇒ Object
Returns the value of attribute port.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(port) ⇒ LLIPPort
constructor
A new instance of LLIPPort.
Constructor Details
#initialize(port) ⇒ LLIPPort
Returns a new instance of LLIPPort.
486 487 488 |
# File 'lib/types.rb', line 486 def initialize(port) @port = port end |
Instance Attribute Details
#port ⇒ Object
Returns the value of attribute port.
485 486 487 |
# File 'lib/types.rb', line 485 def port @port end |
Class Method Details
.decode(data) ⇒ Object
476 477 478 479 |
# File 'lib/types.rb', line 476 def self.decode(data) data = data.unpack('n1a*') return self.new(data[0]), data[1] end |
Instance Method Details
#encode ⇒ Object
481 482 483 |
# File 'lib/types.rb', line 481 def encode() [@port].pack('n1') end |