Class: Cure::Strategy::StartWithStrategy

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)


168
169
170
171
172
173
174
175
# File 'lib/cure/strategy/base.rb', line 168

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

  return generated_value unless replace_partial_record

  @options["match"] + generated_value
  # source_value.chomp(@options["match"]) + generated_value
end

#_retrieve_value(source_value) ⇒ Object

gsub catchment group

Parameters:

  • source_value (String)


161
162
163
# File 'lib/cure/strategy/base.rb', line 161

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