Hello, 

>   Next I've decided to supply attr_reader to access @name and class
>   became:
>   class MyObject
>     attr_reader :name
>     def initialize( name )
>       @name = name
>     end
>   end
> 
>   When I've fetched my object from DRb server and called obj.name I
>   saw error message:
>   undefined method `name' for #<MyClass:0x80e5864>

Did you define attr_reader as each of a server and a client?
Which of a server and a client is that an error comes out?


#-- myobject.rb 
class MyObject
  attr_reader :name
  def initialize( name )
    @name = name
  end
end

#-- store.rb (server)
require 'drb/drb'
require 'myobject'

class MockDB
  def initialize
    @db = {}
  end

  def [](key)
    puts "fetch #{key.inspect}"
    @db[key]
  end

  def []=(key, value)
    puts "store #{key.inspect}, #{value.inspect}"
    @db[key] = value
  end
end

DRb.start_service('druby://localhost:12345', MockDB.new)
DRb.thread.join

#-- client.rb
require 'drb/drb'
require 'myobject'

DRb.start_service

db = DRbObject.new(nil, 'druby://localhost:12345')

foo = MyObject.new('foo')
db[foo.name] = foo

bar = MyObject.new('bar')
db[bar.name] = bar

puts db['foo'].name
puts db['bar'].name