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).
59 60 61 62 63 64 65 |
# File 'lib/class_attribute.rb', line 59 def class_attribute(*attrs) singleton_class.class_eval do attr_accessor(*attrs) end class_attributes.merge(attrs) end |