Module: ClassInheritableAttributes::ClassMethods
- Defined in:
- lib/active_record/support/class_inheritable_attributes.rb
Overview
:nodoc:
Instance Method Summary collapse
- #inheritable_attributes ⇒ Object
- #read_inheritable_attribute(key) ⇒ Object
- #write_inheritable_array(key, elements) ⇒ Object
- #write_inheritable_attribute(key, value) ⇒ Object
Instance Method Details
#inheritable_attributes ⇒ Object
14 15 16 |
# File 'lib/active_record/support/class_inheritable_attributes.rb', line 14 def inheritable_attributes @@classes[self] ||= {} end |
#read_inheritable_attribute(key) ⇒ Object
27 28 29 |
# File 'lib/active_record/support/class_inheritable_attributes.rb', line 27 def read_inheritable_attribute(key) inheritable_attributes[key] end |
#write_inheritable_array(key, elements) ⇒ Object
22 23 24 25 |
# File 'lib/active_record/support/class_inheritable_attributes.rb', line 22 def write_inheritable_array(key, elements) write_inheritable_attribute(key, []) if read_inheritable_attribute(key).nil? write_inheritable_attribute(key, read_inheritable_attribute(key) + elements) end |
#write_inheritable_attribute(key, value) ⇒ Object
18 19 20 |
# File 'lib/active_record/support/class_inheritable_attributes.rb', line 18 def write_inheritable_attribute(key, value) inheritable_attributes[key] = value end |