diff options
Diffstat (limited to 'sample/export.rb')
-rw-r--r-- | sample/export.rb | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/sample/export.rb b/sample/export.rb index a6dfa8e40e..2d05d8afd7 100644 --- a/sample/export.rb +++ b/sample/export.rb @@ -1,18 +1,38 @@ # method access permission # output: # foobar -# foo +# Foo class Foo - export :printf + public :printf + def baz + print "baz\n" + end + private :baz + + def quux + print "in QUUX " + baz() + end end def foobar print "foobar\n" end -f = foo.new -#foo.unexport :printf -foo.export :foobar +f = Foo.new +#Foo.private :printf +Foo.public :foobar f.foobar -f.printf "%s\n", foo +f.printf "%s\n", Foo + +f.quux + +class Bar : Foo + def quux + super + baz() + end +end + +Bar.new.quux |