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)


315
316
317
318
319
# File 'lib/snmp/varbind.rb', line 315

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



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

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