1 # Extends the module object with module and instance accessors for class attributes,
2 # just like the native attr* accessors for instance attributes.
4 def mattr_reader(*syms)
6 next if sym.is_a?(Hash)
7 class_eval(<<-EOS, __FILE__, __LINE__)
8 unless defined? @@#{sym}
23 def mattr_writer(*syms)
24 options = syms.extract_options!
26 class_eval(<<-EOS, __FILE__, __LINE__)
27 unless defined? @@#{sym}
39 " unless options[:instance_writer] == false }
44 def mattr_accessor(*syms)