Class: ChronicTree::Command::RemoveDescendantElements
- Inherits:
-
Object
- Object
- ChronicTree::Command::RemoveDescendantElements
- Defined in:
- lib/chronic_tree/command.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #do ⇒ Object
-
#initialize(source) ⇒ RemoveDescendantElements
constructor
A new instance of RemoveDescendantElements.
Constructor Details
#initialize(source) ⇒ RemoveDescendantElements
Returns a new instance of RemoveDescendantElements.
155 156 157 |
# File 'lib/chronic_tree/command.rb', line 155 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
153 154 155 |
# File 'lib/chronic_tree/command.rb', line 153 def source @source end |
Instance Method Details
#do ⇒ Object
159 160 161 |
# File 'lib/chronic_tree/command.rb', line 159 def do source.flat_descendants.each { |object| RemoveSelfElement.new(object).do } end |