Module: Avm::Sources::Base::Update
- Defined in:
- lib/avm/sources/base/update.rb
Instance Method Summary collapse
-
#on_sub_updated ⇒ Object
To override in subclasses.
- #update ⇒ void
- #update_self(changes) ⇒ void
- #update_self_after_subs ⇒ void
- #update_self_before_subs ⇒ void
-
#update_self_changes_after_subs ⇒ Enumerable<Avm::Sources::Change>
Changes for update after subs' updating.
-
#update_self_changes_before_subs ⇒ Enumerable<Avm::Sources::Change>
Changes for update before subs' updating.
- #update_self_with_change(change) ⇒ void
Instance Method Details
#on_sub_updated ⇒ Object
To override in subclasses.
12 13 14 |
# File 'lib/avm/sources/base/update.rb', line 12 def on_sub_updated # Do nothing end |
#update ⇒ void
This method returns an undefined value.
17 18 19 20 21 |
# File 'lib/avm/sources/base/update.rb', line 17 def update update_self_before_subs update_subs update_self_after_subs end |
#update_self(changes) ⇒ void
This method returns an undefined value.
25 26 27 |
# File 'lib/avm/sources/base/update.rb', line 25 def update_self(changes) changes.each { |change| update_self_with_change(change) } end |
#update_self_after_subs ⇒ void
This method returns an undefined value.
30 31 32 33 |
# File 'lib/avm/sources/base/update.rb', line 30 def update_self_after_subs infov __method__, self update_self(update_self_changes_after_subs) end |
#update_self_before_subs ⇒ void
This method returns an undefined value.
36 37 38 39 |
# File 'lib/avm/sources/base/update.rb', line 36 def update_self_before_subs infov __method__, self update_self(update_self_changes_before_subs) end |
#update_self_changes_after_subs ⇒ Enumerable<Avm::Sources::Change>
Changes for update after subs' updating.
43 44 45 |
# File 'lib/avm/sources/base/update.rb', line 43 def update_self_changes_after_subs [] end |
#update_self_changes_before_subs ⇒ Enumerable<Avm::Sources::Change>
Changes for update before subs' updating.
49 50 51 |
# File 'lib/avm/sources/base/update.rb', line 49 def update_self_changes_before_subs [] end |
#update_self_with_change(change) ⇒ void
This method returns an undefined value.
55 56 57 58 59 60 61 |
# File 'lib/avm/sources/base/update.rb', line 55 def update_self_with_change(change) infov 'Performing change', change scm.commit_if_change(-> { change. }) do change.perform parent.if_present(&:on_sub_updated) end end |