Class: Defmastership::Modifier::UpdateIrefChecksum::Helper::IrefReplacementFormatterChecksum
- Inherits:
-
ReplacementFormatter
- Object
- ReplacementFormatter
- Defmastership::Modifier::UpdateIrefChecksum::Helper::IrefReplacementFormatterChecksum
- Defined in:
- lib/defmastership/modifier/update_iref_checksum.rb
Overview
A small, single-purpose class to format the iref replacement string.
Instance Method Summary collapse
-
#initialize(match_data, document) ⇒ IrefReplacementFormatterChecksum
constructor
A new instance of IrefReplacementFormatterChecksum.
-
#to_s ⇒ String
The formatted string or the original match if no definition is found.
Constructor Details
#initialize(match_data, document) ⇒ IrefReplacementFormatterChecksum
Returns a new instance of IrefReplacementFormatterChecksum.
38 39 40 |
# File 'lib/defmastership/modifier/update_iref_checksum.rb', line 38 def initialize(match_data, document) super(match_data, document, :intref) end |
Instance Method Details
#to_s ⇒ String
Returns the formatted string or the original match if no definition is found.
43 44 45 46 47 |
# File 'lib/defmastership/modifier/update_iref_checksum.rb', line 43 def to_s return match_data unless definition "defs:iref[#{reference_string}(#{match_data[:explicit_version]}#{definition.sha256_short})]" end |