Module: ClassAttribute::ClassMethods
- Defined in:
- lib/class_attribute.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#class_attribute(*attrs) ⇒ void
Sets a class level attr_accessor(s) for the given attribute(s).
Instance Method Details
#class_attribute(*attrs) ⇒ void
This method returns an undefined value.
Sets a class level attr_accessor(s) for the given attribute(s).
54 55 56 57 58 59 60 |
# File 'lib/class_attribute.rb', line 54 def class_attribute(*attrs) singleton_class.class_eval do attr_accessor *attrs end class_attributes.merge(attrs) end |