summaryrefslogtreecommitdiff
path: root/sample/export.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/export.rb')
-rw-r--r--sample/export.rb32
1 files changed, 26 insertions, 6 deletions
diff --git a/sample/export.rb b/sample/export.rb
index a6dfa8e..2d05d8a 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