Class: Defmastership::Modifier::UpdateIrefVersion

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

Overview

Update internal refs checksum

Defined Under Namespace

Modules: Helper

Instance Attribute Summary

Attributes included from ModifierCommon

#changes, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModifierCommon

#do_modifications, #method_missing, #respond_to_missing?, #setup_modifier_module

Methods inherited from UpdateIref

default_config, #do_modifications, #initialize

Constructor Details

This class inherits a constructor from Defmastership::Modifier::UpdateIref

Dynamic Method Handling

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

Class Method Details

.replacement_methodsArray<Symbol>

Methods’s symbols will be called in sequence to perform the document modifications

Returns:

  • (Array<Symbol>)

    the two symbols of replacement methods



17
18
19
# File 'lib/defmastership/modifier/update_iref_version.rb', line 17

def self.replacement_methods
  %i[replace_irefs]
end

Instance Method Details

#replace_irefs(_filename, line) ⇒ String

Replace the definition’s internal ref in the line if relevant

Parameters:

  • _filename (String)

    the filename of the file beeing modified

  • line (String)

    the current line

Returns:

  • (String)

    the modified line



26
27
28
29
30
# File 'lib/defmastership/modifier/update_iref_version.rb', line 26

def replace_irefs(_filename, line)
  line.gsub(Core::DMRegexp::IREF_DEF) do
    Helper::IrefReplacementFormatterVersion.new(Regexp.last_match, document).to_s
  end
end