Closed kmcphillips closed 6 years ago
The Measured::ConversionTable is built as a module where each method passes in the state.
Measured::ConversionTable
This is pretty unnecessary. It makes the signatures messy and it's way harder to refactor as I'm trying to do for #103.
Convert it from a module to a class. Instantiate it and call #to_h. No functional change, just an internal API change.
#to_h
It's split into a three step refactor, so looking at each commit individually can make it clearer.
Problem
The
Measured::ConversionTable
is built as a module where each method passes in the state.This is pretty unnecessary. It makes the signatures messy and it's way harder to refactor as I'm trying to do for #103.
Solution
Convert it from a module to a class. Instantiate it and call
#to_h
. No functional change, just an internal API change.