From: Fily Salas Date: 2011-11-10T00:27:40+09:00 Subject: Re: How can I overwrite class variables Wow! I knew someone would come with a better solution. Awesome! I'm not trying to improve your code I'm just trying to practice by overwriting variables (in this case an instance variable not a class variable). ---------------------------------------- class Machine def initialize(part_width, part_length) @part_width = part_width @part_length = part_length end def laser @kerf = 20 calc end def turret @kerf = 10 calc end 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 end machine1 = Machine.new(10 , 20) machine1.laser machine1.turret ---------------------------------------------------- This makes me feel good and bad, good because its increible to see people helping others and whats best see people that identify the problem in a metter of seconds (you guys are awesome) and bad becuase I could't figure this out by my self :( Thanks a lot -- Posted via http://www.ruby-forum.com/.