# File lib/ldap/control.rb, line 16 def Control.encode( *vals ) encoded_vals = [] vals.each do |val| encoded_vals << case val when Integer OpenSSL::ASN1::Integer( val ) when String OpenSSL::ASN1::OctetString.new( val ) else # What other types may exist? end end OpenSSL::ASN1::Sequence.new( encoded_vals ).to_der end