Top Level Namespace
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#mattr_accessor(*syms) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/hussh.rb', line 30 def mattr_accessor(*syms) syms.each do |sym| class_eval(<<EOD) @@#{sym} = nil unless defined? @@#{sym} def self.#{sym} @@#{sym} end def self.#{sym}=(obj) @@#{sym} = obj end EOD end end |