Class: Cure::Strategy::MatchStrategy

Inherits:
Base
  • Object
show all
Defined in:
lib/cure/strategy/base.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#extract, #initialize

Methods included from History

#history, #reset_history, #retrieve_history, #store_history

Constructor Details

This class inherits a constructor from Cure::Strategy::Base

Instance Method Details

#_replace_value(source_value, generated_value) ⇒ String

Parameters:

  • source_value (String)
  • generated_value (String)

Returns:

  • (String)


151
152
153
154
155
# File 'lib/cure/strategy/base.rb', line 151

def _replace_value(source_value, generated_value)
  return unless source_value.include? @options["match"]

  source_value.gsub(@options["match"], generated_value)
end

#_retrieve_value(source_value) ⇒ Object

gsub catchment group

Parameters:

  • source_value (String)


144
145
146
# File 'lib/cure/strategy/base.rb', line 144

def _retrieve_value(source_value)
  @options["match"] || nil if source_value.include? @options["match"]
end