Class: StructFu::Int16le

Inherits:
Int16 show all
Defined in:
lib/packetfu/structfu.rb

Overview

Int16le is a two byte value in little-endian format. The endianness cannot be altered.

Instance Attribute Summary

Attributes inherited from Int

#default, #endian, #value, #width

Instance Method Summary collapse

Methods inherited from Int16

#to_s

Methods inherited from Int

#read, #to_f, #to_i, #to_s

Methods inherited from Struct

#force_binary

Constructor Details

#initialize(v = nil, e = :little) ⇒ Int16le

Returns a new instance of Int16le.



134
135
136
137
# File 'lib/packetfu/structfu.rb', line 134

def initialize(v=nil, e=:little)
  super(v,e)
  @packstr = (self.e == :big) ? "n" : "v"
end