Class: SNMP::UnsignedInteger
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ UnsignedInteger
constructor
A new instance of UnsignedInteger.
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.
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 |