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)

350
351
352
353
354
# File 'lib/snmp/varbind.rb', line 350

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


356
357
358
# File 'lib/snmp/varbind.rb', line 356

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