Module: ProtectedParent::ClassMethods
- Defined in:
- lib/protected_parent/protected_parent_of.rb
Instance Method Summary collapse
- #children_of_protected_parent ⇒ Object
- #protected_parent_of(*children_names) ⇒ Object
- #softly_protected ⇒ Object
Instance Method Details
#children_of_protected_parent ⇒ Object
21 22 23 |
# File 'lib/protected_parent/protected_parent_of.rb', line 21 def children_of_protected_parent @children_of_protected_parent ||= [] end |
#protected_parent_of(*children_names) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/protected_parent/protected_parent_of.rb', line 10 def protected_parent_of(*children_names) @softly_protected = children_names..delete(:protects) == :softly children_names.each do |child_name| self.children_of_protected_parent << child_name.to_s end before_destroy :removable? end |
#softly_protected ⇒ Object
25 26 27 |
# File 'lib/protected_parent/protected_parent_of.rb', line 25 def softly_protected @softly_protected end |