Class: ChronicTree::Command::RemoveDescendantElements

Inherits:
Object
  • Object
show all
Defined in:
lib/chronic_tree/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sourceObject (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

#doObject



159
160
161
# File 'lib/chronic_tree/command.rb', line 159

def do
  source.flat_descendants.each { |object| RemoveSelfElement.new(object).do }
end