Class: DefMastership::BatchModifier
- Inherits:
-
Object
- Object
- DefMastership::BatchModifier
- Defined in:
- lib/defmastership/batch_modifier.rb
Overview
Change references from temporary to definitive with multiple RefChangers
Instance Attribute Summary collapse
-
#adoc_sources ⇒ Object
readonly
Returns the value of attribute adoc_sources.
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #apply(modifs) ⇒ Object
-
#initialize(config, adoc_sources) ⇒ BatchModifier
constructor
A new instance of BatchModifier.
Constructor Details
#initialize(config, adoc_sources) ⇒ BatchModifier
Returns a new instance of BatchModifier.
9 10 11 12 13 |
# File 'lib/defmastership/batch_modifier.rb', line 9 def initialize(config, adoc_sources) @config = config @adoc_sources = adoc_sources @changes = [] end |
Instance Attribute Details
#adoc_sources ⇒ Object (readonly)
Returns the value of attribute adoc_sources.
7 8 9 |
# File 'lib/defmastership/batch_modifier.rb', line 7 def adoc_sources @adoc_sources end |
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
7 8 9 |
# File 'lib/defmastership/batch_modifier.rb', line 7 def changes @changes end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/defmastership/batch_modifier.rb', line 7 def config @config end |
Instance Method Details
#apply(modifs) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/defmastership/batch_modifier.rb', line 15 def apply(modifs) modifs.each do |modif| modifier = modifier_from(modif) @adoc_sources = modifier.do_modifications(adoc_sources) config.fetch(modif)[:config] = modifier.config collect_changes(modifier, modif) end end |