summaryrefslogtreecommitdiff
path: root/sample/export.rb
blob: 750b5c19484d702bac7d864a8f62645f76addbff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# method access permission
# output:
#	foobar
#	Foo

class Foo
  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.private :printf
Foo.public :foobar
f.foobar
f.printf "%s\n", Foo

f.quux

class Bar<Foo
  def quux
    super
    baz()
  end
end

Bar.new.quux