Jason  Vogel:
> class A
> 
> 	attr_accessor :id
> 	attr_accessor :name
> 
> 	def initialize(id = nil, name = nil)
> 		@id = id
> 		@name = name
> 	end
> end
> 
# [...]
> require 'a'
> 
> a1 = A.new(:name => "test")
> a2 = A.new(:name => "test2")
> 
> p a1
> p a2
> 
> Results:
> #<A:0x28c2d80 @id={:name=>"test"}, @name=nil>
> #<A:0x28c2678 @id={:name=>"test2"}, @name=nil>

Your initialize method takes two (optional) arguments, the first of which
is id. In your calls to A.new, you're passing exactly one argument, which
is why id gets set, and name does not. More precisely, 

	A.new(:name => 'test')

is the same as

	A.new({:name => 'test'})

so you're passing a Hash. To achieve what you may want, do

	def initialize(opt = {})
	  @id = opt[:id]
	  @name = opt[:name]
	end

Kalman