Class: SNMP::UnsignedInteger

Inherits:
Integer
  • Object
show all
Defined in:
lib/snmp/varbind.rb

Direct Known Subclasses

Counter32, Gauge32, TimeTicks, Unsigned32

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Integer

#<=>, #asn1_type, #coerce, #encode, #to_f, #to_i, #to_oid, #to_s

Constructor Details

#initialize(value) ⇒ UnsignedInteger

Returns a new instance of UnsignedInteger.

Raises:

  • (ArgumentError)


320
321
322
323
324
# File 'lib/snmp/varbind.rb', line 320

def initialize(value)
  super(value)
  raise ArgumentError, "Negative integer invalid: #{value}" if value < 0
  raise ArgumentError, "Out of range: #{value}" if value > 4294967295
end

Class Method Details

.decode(value_data) ⇒ Object



326
327
328
# File 'lib/snmp/varbind.rb', line 326

def self.decode(value_data)
  self.new(decode_uinteger_value(value_data))
end