O'Reilly logo
  • Ronald Cosentino thinks this is interesting:

Great! So far we’ve got a Monkey class with two methods and a class variable. The class variable @@bananas keeps track of how many bananas there are for all monkey instances, the initialize method sets the monkey’s name when Monkey.new is called, and eat_banana decreases @@bananas by 1.


Cover of Ruby Wizardry


in's name when Monkey.new is call and eaitialize methond set the monkey's name when Monkey.new is called and eat_banana decreases @@bananas by 1.