Class: PacketGen::Types::Int16
Overview
2-byte unsigned integer
Instance Attribute Summary
Attributes inherited from Int
#default, #endian, #value, #width
Instance Method Summary collapse
-
#initialize(value = nil, endian = :big) ⇒ Int16
constructor
A new instance of Int16.
Methods inherited from Int
#format_inspect, #nbits, #read, #sz, #to_f, #to_i, #to_s
Methods included from Fieldable
#format_inspect, #read, #sz, #to_human, #to_s, #type_name
Constructor Details
#initialize(value = nil, endian = :big) ⇒ Int16
Returns a new instance of Int16.
135 136 137 138 |
# File 'lib/packetgen/types/int.rb', line 135 def initialize(value=nil, endian=:big) super(value, endian, 2) @packstr = { big: 'n', little: 'v', native: 'S' } end |