Class: DefMastership::BatchModifier

Inherits:
Object
  • Object
show all
Defined in:
lib/defmastership/batch_modifier.rb

Overview

Change references from temporary to definitive with multiple RefChangers

Instance Attribute Summary collapse

Instance Method Summary collapse

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_sourcesObject (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

#changesObject (readonly)

Returns the value of attribute changes.



7
8
9
# File 'lib/defmastership/batch_modifier.rb', line 7

def changes
  @changes
end

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