summaryrefslogtreecommitdiff
path: root/test/ruby/namespace/instance_variables.rb
blob: 1562ad5d450629c60279de2b8f39a7d14ece0eb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class String
  class << self
    attr_reader :str_ivar1

    def str_ivar2
      @str_ivar2
    end
  end

  @str_ivar1 = 111
  @str_ivar2 = 222
end

class StringDelegator < BasicObject
private
  def method_missing(...)
    ::String.public_send(...)
  end
end

StringDelegatorObj = StringDelegator.new