Class: PacketGen::Types::SInt16
- Defined in:
- lib/packetgen/types/int.rb
Overview
2-byte signed integer
Instance Attribute Summary
Attributes inherited from Int
#default, #endian, #value, #width
Instance Method Summary collapse
-
#initialize(value = nil, endian = :big) ⇒ SInt16
constructor
A new instance of SInt16.
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) ⇒ SInt16
Returns a new instance of SInt16.
178 179 180 181 |
# File 'lib/packetgen/types/int.rb', line 178 def initialize(value=nil, endian=:big) super @packstr = { big: 's>', little: 's<', native: 's' } end |