1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'metaid'

class I
  def shared
    self.class.metaclass.shared
  end

  class << self
    attr_accessor :shared
    def start
      @shared = {}
    end
  end
end

I.start
I.shared       #=> {}
I.new.shared   #=> NoMethodError: undefined method `shared' for #<Class:I>