Class: Defmastership::Modifier::UpdateIref

Inherits:
Object
  • Object
show all
Includes:
ModifierCommon
Defined in:
lib/defmastership/modifier/update_iref_common.rb

Overview

Update internal refs checksum

Direct Known Subclasses

UpdateIrefChecksum, UpdateIrefVersion

Instance Attribute Summary

Attributes included from ModifierCommon

#changes, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModifierCommon

#method_missing, #respond_to_missing?, #setup_modifier_module

Constructor Details

#initialize(config) ⇒ UpdateIref

Returns a new instance of UpdateIref.

Parameters:

  • config (YAML)

    the modifier’s provided configurations



20
21
22
23
24
# File 'lib/defmastership/modifier/update_iref_common.rb', line 20

def initialize(config)
  @document = Document.new

  setup_modifier_module(config)
end

Dynamic Method Handling

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

Class Method Details

.default_configHash{Symbol => Object}

Returns the default configuration.

Returns:

  • (Hash{Symbol => Object})

    the default configuration



15
16
17
# File 'lib/defmastership/modifier/update_iref_common.rb', line 15

def self.default_config
  {}
end

Instance Method Details

#do_modifications(adoc_sources) ⇒ Object

Apply the modifier on all provided asciidoc sources based on modifier’s self.replacement_methods list

Parameters:

  • adoc_sources (Hash{String => String})

    asciidoc sources

    • :key filename

    • :value file content



32
33
34
35
36
37
38
# File 'lib/defmastership/modifier/update_iref_common.rb', line 32

def do_modifications(adoc_sources)
  adoc_sources.each_key do |adoc_file|
    document.parse_file_with_preprocessor(adoc_file)
  end

  super
end