From: Leon Bogaert Date: 2008-03-21T07:55:09+09:00 Subject: including instance methods and setting an instance variable Hi all, I'm trying to include a module and in that module I want to set an instance variable. I have the following: class Queue include LBo::InstanceMethods end module LBo module InstanceMethods attr_accessor :position self.position = 1 end end q = Queue.new q.position But I'm getting this error: undefined method `position=' for LBo::InstanceMethods:Module (NoMethodError) I'm feeling like a moron because I can't understand why this is not working. I tried setting the @position variable directly, but when I do q.position it gives back nil. Could somebody lend me a hand with this one? Thanks in advance! -- Posted via http://www.ruby-forum.com/.