From: Robert Klemme Date: 2012-06-11T16:23:08+09:00 Subject: Re: Accessing Variables from Within a Module On Sun, Jun 10, 2012 at 8:13 PM, Doug Jolley wrote: >> module MyModule >>  def MyModule.test1(obj) >>    puts(obj.fname()) >>  end >> end > > YES!!! This is the solution to my problem! Strangely, I came up with the > same thing as I reflected on the issue over last evening. Good. > When I post a question here I generally try to present an illustrative > code fragment that removes all the fluff from the real code and just > focuses on the precise issue.  Regardless of how careful I am, it seems > that something always gets lost in the translation. I guess it's just normal in the course of communication - especially with text only media. One often needs a few rounds back and forth to come to a common understanding. Nothing to worry about. > Thanks to all who contributed. You're welcome! Kind regards robert PS: One remark: I prefer to use "self" over the module name when defining methods of the module. That reduces redundancy and makes it easier to change the module's name. -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/