From: Stuart Brand Date: 2006-08-01T21:03:26+09:00 Subject: Re: class is converting fixnum to array!?! this is the full class and code to call it, it out puts fixnum then array class Ldap def self.auth(name) ldap= Net::LDAP.new :host => '172.16.1.1', :port => 389, :auth => {:method => :simple,:username => "ldapquery@example.com",:password => "password"} filter = Net::LDAP::Filter.eq( "samaccountname", "#{name}" ) treebase = "ou=accounts,dc=example,dc=com" ldap.search( :base => treebase, :filter => filter ) do |entry| if "#{entry["samaccountname"]}" == "#{name}" then return 1 else return 0 end end end end address = "user@example.com" username = "#{address}".sub(/@.*/, '') puts user.class user = Ldap.auth(username) puts user.class -- Posted via http://www.ruby-forum.com/.