Class: Cure::Transformation::Translation

Inherits:
Object
  • Object
show all
Includes:
Helpers::ObjectHelpers
Defined in:
lib/cure/transformation/candidate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::ObjectHelpers

#class_exists?

Constructor Details

#initialize(strategy, generator) ⇒ Translation

Returns a new instance of Translation.



85
86
87
88
# File 'lib/cure/transformation/candidate.rb', line 85

def initialize(strategy, generator)
  @strategy = strategy
  @generator = generator
end

Instance Attribute Details

#generatorGenerator::BaseGenerator (readonly)

What sort of data needs to be generated.



83
84
85
# File 'lib/cure/transformation/candidate.rb', line 83

def generator
  @generator
end

#strategyStrategy::BaseStrategy (readonly)

What sort of replacement is done, full/random/lookup/partial.



79
80
81
# File 'lib/cure/transformation/candidate.rb', line 79

def strategy
  @strategy
end

Instance Method Details

#extract(source_value, row_ctx) ⇒ String

Parameters:

Returns:



92
93
94
# File 'lib/cure/transformation/candidate.rb', line 92

def extract(source_value, row_ctx)
  @strategy.extract(source_value, row_ctx, @generator)
end