Class: GoldenFleece::Normalizer
- Inherits:
-
Object
- Object
- GoldenFleece::Normalizer
- Defined in:
- lib/golden_fleece/normalizer.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, fn) ⇒ Normalizer
constructor
A new instance of Normalizer.
- #normalize(record, value) ⇒ Object
Constructor Details
#initialize(name, fn) ⇒ Normalizer
Returns a new instance of Normalizer.
5 6 7 8 |
# File 'lib/golden_fleece/normalizer.rb', line 5 def initialize(name, fn) @name = name @fn = fn end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/golden_fleece/normalizer.rb', line 3 def name @name end |
Instance Method Details
#normalize(record, value) ⇒ Object
10 11 12 |
# File 'lib/golden_fleece/normalizer.rb', line 10 def normalize(record, value) fn.call record, value end |