Class: PacketGen::StructFu::Int64
- Defined in:
- lib/packetgen/structfu.rb
Overview
Int64 is a eight byte value.
Instance Attribute Summary
Attributes inherited from Int
#default, #endian, #value, #width
Instance Method Summary collapse
-
#initialize(v = nil, e = :big) ⇒ Int64
constructor
A new instance of Int64.
-
#to_s ⇒ Object
Returns a eight byte value as a packed string.
Methods inherited from Int
Methods inherited from Struct
Constructor Details
#initialize(v = nil, e = :big) ⇒ Int64
Returns a new instance of Int64.
209 210 211 212 |
# File 'lib/packetgen/structfu.rb', line 209 def initialize(v=nil, e=:big) super(v, e, w=4) @packstr = (self.e == :big) ? 'Q>' : 'Q<' end |
Instance Method Details
#to_s ⇒ Object
Returns a eight byte value as a packed string.
215 216 217 218 |
# File 'lib/packetgen/structfu.rb', line 215 def to_s @packstr = (self.e == :big) ? 'Q>' : 'Q<' [(self.v || self.d)].pack(@packstr) end |