Class StructFu::Int
In: lib/packetfu/structfu.rb
Parent: Struct.new(:value, :endian, :width, :default)

Ints all have a value, an endianness, and a default value. Note that the signedness of Int values are implicit as far as the subclasses are concerned; to_i and to_f will return Integer/Float versions of the input value, instead of attempting to unpack the pack value. (This can be a useful hint to other functions).

Header Definition

  Fixnum  :value
  Symbol  :endian
  Fixnum  :width
  Fixnum  :default

Methods

new   read   to_f   to_i   to_s  

External Aliases

value= -> v=
value -> v
endian= -> e=
endian -> e
width= -> w=
width -> w
default= -> d=
default -> d

Public Class methods

Public Instance methods

Reads either an Integer or a packed string, and populates the value accordingly.

Returns the Int as a Float.

Returns the Int as an Integer.

This is a parent class definition and should not be used directly.

[Validate]