Class: SNMP::Counter64

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Integer

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

Constructor Details

#initialize(value) ⇒ Counter64

Returns a new instance of Counter64

Raises:

  • (ArgumentError)


442
443
444
445
446
# File 'lib/snmp/varbind.rb', line 442

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

Class Method Details

.decode(value_data) ⇒ Object



434
435
436
# File 'lib/snmp/varbind.rb', line 434

def self.decode(value_data)
  Counter64.new(decode_integer_value(value_data))
end

Instance Method Details

#asn1_typeObject



438
439
440
# File 'lib/snmp/varbind.rb', line 438

def asn1_type
  "Counter64"
end

#encodeObject



448
449
450
# File 'lib/snmp/varbind.rb', line 448

def encode
  encode_tagged_integer(Counter64_TAG, @value)
end