Module: RorHack::ModuleHack

Included in:
Module
Defined in:
lib/ror_hack/module_hack.rb

Instance Method Summary collapse

Instance Method Details

#singleton_attr_accessor(*args) ⇒ Object

创建类对象的实例变量。



4
5
6
7
8
# File 'lib/ror_hack/module_hack.rb', line 4

def singleton_attr_accessor(*args)
  singleton_class.class_eval do
    attr_accessor(*args)
  end
end