Class: DefMastership::UpdateDefVersionModifier

Inherits:
UpdateDefModifier show all
Defined in:
lib/defmastership/update_def_version_modifier.rb

Overview

modify one line after another

Defined Under Namespace

Modules: Helper

Instance Attribute Summary

Attributes inherited from UpdateDefModifier

#document

Attributes included from Modifier

#changes, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UpdateDefModifier

reference_regexp, #replace_reference, replacement_methods

Methods included from Modifier

#apply_to_all, #apply_to_one, #method_missing, #respond_to_missing?, #setup_modifier_module

Constructor Details

#initialize(config) ⇒ UpdateDefVersionModifier

Returns a new instance of UpdateDefVersionModifier.



18
19
20
21
22
# File 'lib/defmastership/update_def_version_modifier.rb', line 18

def initialize(config)
  @ref_document = Document.new

  super(config)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DefMastership::Modifier

Class Method Details

.default_configObject



10
11
12
13
14
15
16
# File 'lib/defmastership/update_def_version_modifier.rb', line 10

def self.default_config
  {
    def_type: '',
    ref_document: '',
    first_version: ''
  }
end

Instance Method Details

#do_modifications(adoc_sources) ⇒ Object



24
25
26
27
28
# File 'lib/defmastership/update_def_version_modifier.rb', line 24

def do_modifications(adoc_sources)
  @ref_document.parse_file_with_preprocessor(config.fetch(:ref_document))

  super(adoc_sources)
end