Module: ClassInheritableAttributes::ClassMethods
- Defined in:
- lib/action_controller/support/class_inheritable_attributes.rb
Overview
:nodoc:
Instance Method Summary collapse
- #inheritable_attributes ⇒ Object
- #read_inheritable_attribute(key) ⇒ Object
- #reset_inheritable_attributes ⇒ Object
- #write_inheritable_array(key, elements) ⇒ Object
- #write_inheritable_attribute(key, value) ⇒ Object
Instance Method Details
#inheritable_attributes ⇒ Object
14 15 16 |
# File 'lib/action_controller/support/class_inheritable_attributes.rb', line 14 def inheritable_attributes @@classes[self] ||= {} end |
#read_inheritable_attribute(key) ⇒ Object
27 28 29 |
# File 'lib/action_controller/support/class_inheritable_attributes.rb', line 27 def read_inheritable_attribute(key) inheritable_attributes[key] end |
#reset_inheritable_attributes ⇒ Object
31 32 33 |
# File 'lib/action_controller/support/class_inheritable_attributes.rb', line 31 def reset_inheritable_attributes inheritable_attributes.clear end |
#write_inheritable_array(key, elements) ⇒ Object
22 23 24 25 |
# File 'lib/action_controller/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/action_controller/support/class_inheritable_attributes.rb', line 18 def write_inheritable_attribute(key, value) inheritable_attributes[key] = value end |