Class: Takumi::Packet::Ushort
- Inherits:
-
Object
- Object
- Takumi::Packet::Ushort
- Defined in:
- lib/takumi/packet/ushort.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ushort) ⇒ Ushort
constructor
A new instance of Ushort.
- #to_s ⇒ Object
Constructor Details
#initialize(ushort) ⇒ Ushort
Returns a new instance of Ushort.
10 11 12 |
# File 'lib/takumi/packet/ushort.rb', line 10 def initialize(ushort) @ushort = ushort end |
Class Method Details
.decode(source) ⇒ Object
5 6 7 |
# File 'lib/takumi/packet/ushort.rb', line 5 def decode(source) return source[0..1].unpack("n"), 2 end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/takumi/packet/ushort.rb', line 14 def to_s [@ushort].pack("n") end |