Mega Code Archive

 
Categories / Ruby / Class
 

When you use an access modifier, all the methods that follow are defined with that access, until you use a different access modifier

class Animal   def initialize(color)     @color = color   end   public   def get_color     return @color   end   private   def get_feet     return "four"   end   def get_sound     return "Bark"   end end