From: James Hans Date: 2010-05-15T03:34:01+09:00 Subject: Propogate variable up to included module Hey folks, I have a module which I'm using to contain a lot of strings that my objects print out. I want to use a module because it seems better to me to put the data in a separate location than my object implementation, so I can more easily see the logic of my object. My object builds a set of text files. Each of these text files has sections within them that are customised based upon a string handed in to the object, such that: bill = textFile.new("bill") bill.header #returns "This is the header for bill" bill.comment #returns "Bill is implemented with the following options:" followed by the unique options for bill. ted = textFile.new("ted") ted.header #returns "This is the header for ted" ted.comment #returns "ted is implemented with the following options:" followed by the unique options for ted. and so on. Now, what I want is to have my Textfile class include a data module. The data module contains all of the strings "This is the header for #{variable}", "#{variable} is implemented with the following options:". As such, I need to pass the argument to the textfile's new method back up into the module that the textfile includes. I guess the question is, is there a way to reference a variable from a class in a module that the class will include? Thanks -- Posted via http://www.ruby-forum.com/.