From: "Jordan G." Date: 2013-02-24T08:53:02+09:00 Subject: help with initialize method that involves readlines i'm trying to set up a list or library of sorts that holds the info for the objects in my program. Since i am working with atoms and molecules i know all of the possible parameters, as in an atom with an atomic number of 1 has to be hydrogen and the abbreviation has to be H. i feel like i can set up my initialize method to read a specified line in an outside file and use it for the @variables. i have an idea of how the process would go but don't know how to write it out yet. below is what i have in mind but it should be obvious where i'm confused because i just describe what i want in human words class Atom def initialize(x) open(atom_name.txt, atom_abr.txt)readlines(x) @atom_name = line x of atom_name.txt @abbreviation = line x of atom_abr.txt end end x will be a number 1 through 118 -- Posted via http://www.ruby-forum.com/.