Class: Beowulf::Type::Uint32

Inherits:
Serializer show all
Defined in:
lib/beowulf/type/u_int32.rb

Instance Method Summary collapse

Methods included from Utils

#debug, #error, #extract_signatures, #hexlify, #pakArr, #pakC, #pakHash, #pakI, #pakL!, #pakPubKey, #pakQ, #pakS, #pakStr, #pakc, #pakq, #paks, #send_log, #unhexlify, #varint, #warning

Constructor Details

#initialize(value) ⇒ Uint32

Returns a new instance of Uint32.



4
5
6
# File 'lib/beowulf/type/u_int32.rb', line 4

def initialize(value)
  super(:u_int_32, value.to_i)
end

Instance Method Details

#to_bytesObject



8
9
10
# File 'lib/beowulf/type/u_int32.rb', line 8

def to_bytes
  [@value].pack('L')
end

#to_sObject



12
13
14
# File 'lib/beowulf/type/u_int32.rb', line 12

def to_s
  @value.to_s
end