summaryrefslogtreecommitdiff
path: root/spec/ruby/language/fixtures/private.rb
blob: da3e0a97f9e1d3c84ee78fffe481885d92b17dbf (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module Private
  class A
    def foo
      "foo"
    end

    private
    def bar
      "bar"
    end
  end

  class B
    def foo
      "foo"
    end

    private

    def self.public_defs_method; 0; end

    class C
      def baz
        "baz"
      end
    end

    class << self
      def public_class_method1; 1; end
      private
      def private_class_method1; 1; end
    end

    def bar
      "bar"
    end
  end

  module D
    private
    def foo
      "foo"
    end
  end

  class E
    include D
  end

  class G
    def foo
      "foo"
    end
  end

  class H < A
    private :foo
  end
end