1# method access permission 2# output: 3# foobar 4# Foo 5 6class Foo 7 public :printf 8 def baz 9 print "baz\n" 10 end 11 private :baz 12 13 def quux 14 print "in QUUX " 15 baz() 16 end 17end 18 19def foobar 20 print "foobar\n" 21end 22 23f = Foo.new 24#Foo.private :printf 25class Foo # redefines foobar's scope 26 public :foobar 27end 28f.foobar 29f.printf "%s\n", Foo 30 31f.quux 32 33class Bar<Foo 34 def quux 35 super 36 baz() 37 end 38end 39 40Bar.new.quux 41