Array
# File lib/snmp/varbind.rb, line 20 def self.decode(data, mib=nil) list = VarBindList.new varbind_data, remainder = decode_sequence(data) while varbind_data != "" varbind, varbind_data = VarBind.decode(varbind_data, mib) list << varbind end return list, remainder end
# File lib/snmp/varbind.rb, line 30 def initialize(varbind_list=[]) super() if varbind_list.respond_to? :to_str self << ObjectId.new(varbind_list.to_str).to_varbind elsif varbind_list.respond_to? :to_varbind self << varbind_list.to_varbind else varbind_list.each do |item| if item.respond_to? :to_str self << ObjectId.new(item.to_str).to_varbind else self << item.to_varbind end end end end
Generated with the Darkfish Rdoc Generator 2.