Class: ChronicTree::Command::AddChildElementsToReplacedObject
- Inherits:
-
Object
- Object
- ChronicTree::Command::AddChildElementsToReplacedObject
- Defined in:
- lib/chronic_tree/command.rb
Instance Attribute Summary collapse
-
#child_elements ⇒ Object
readonly
Returns the value of attribute child_elements.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#source_root_id ⇒ Object
readonly
Returns the value of attribute source_root_id.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #do ⇒ Object
-
#initialize(source, source_root_id, target, child_elements) ⇒ AddChildElementsToReplacedObject
constructor
A new instance of AddChildElementsToReplacedObject.
Constructor Details
#initialize(source, source_root_id, target, child_elements) ⇒ AddChildElementsToReplacedObject
Returns a new instance of AddChildElementsToReplacedObject.
126 127 128 129 130 131 |
# File 'lib/chronic_tree/command.rb', line 126 def initialize(source, source_root_id, target, child_elements) @source = source @source_root_id = source_root_id @target = target @child_elements = child_elements end |
Instance Attribute Details
#child_elements ⇒ Object (readonly)
Returns the value of attribute child_elements.
124 125 126 |
# File 'lib/chronic_tree/command.rb', line 124 def child_elements @child_elements end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
124 125 126 |
# File 'lib/chronic_tree/command.rb', line 124 def source @source end |
#source_root_id ⇒ Object (readonly)
Returns the value of attribute source_root_id.
124 125 126 |
# File 'lib/chronic_tree/command.rb', line 124 def source_root_id @source_root_id end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
124 125 126 |
# File 'lib/chronic_tree/command.rb', line 124 def target @target end |
Instance Method Details
#do ⇒ Object
133 134 135 |
# File 'lib/chronic_tree/command.rb', line 133 def do child_elements.each { |el| AddChildElement.new(target, el.child_id, el.distance).do } end |