From: "Duan, Jingjing" Date: 2011-11-10T01:38:51+09:00 Subject: Re: How can I overwrite class variables There are two ways (maybe more) to define methods as private. 1. class C private # every method following will be private def m1 ... end def m2 ... end end 2. class C def m1 ... end def m2 ... end private :m1, :m2 end In both cases, m1 and m2 would be private. Of course, in Ruby nothing is fixed. You can make private methods public again if you really want to. -Jingjing -----Original Message----- From: Fily Salas [mailto:fs_tigre@hotmail.com] Sent: Wednesday, November 09, 2011 8:30 AM To: ruby-talk ML Subject: Re: How can I overwrite class variables Marc Heiler wrote in post #1031087: >> bad because I could't figure this out by my self > > You just need to write more ruby code. > > Ideally, write small classes that solve a given problem, > then re-use those classes to make a larger project. Do you know of any tutorials where you can actually practice Ruby in actual projects? Not tutorials on the Ruby syntax (projects using Ruby) I have another question, in Peters code he used "private" but if I remove it, it actually works can someone explain the use of private here, is this the way of making a private def in Ruby? ---------------------------------- private def calc sheet_width = 60 sheet_length = 120 parts_y = sheet_width / (@part_width + @kerf) parts_x = sheet_length / (@part_length + @kerf) puts parts_y * parts_x end --------------------------------- -- Posted via http://www.ruby-forum.com/.