Class: Clienteer::Digester::IndexesCleanUp
- Inherits:
-
Object
- Object
- Clienteer::Digester::IndexesCleanUp
- Defined in:
- lib/clienteer/digesters/indexes_clean_up.rb
Instance Method Summary collapse
- #get_index(attr, row:) ⇒ Object
-
#initialize ⇒ IndexesCleanUp
constructor
A new instance of IndexesCleanUp.
- #process(row) ⇒ Object
Constructor Details
#initialize ⇒ IndexesCleanUp
Returns a new instance of IndexesCleanUp.
4 5 |
# File 'lib/clienteer/digesters/indexes_clean_up.rb', line 4 def initialize end |
Instance Method Details
#get_index(attr, row:) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/clienteer/digesters/indexes_clean_up.rb', line 12 def get_index(attr, row: ) indexes = row["indexes"] if indexes.is_a? Hash if indexes[:name] == row return pull_out_attr from: indexes end else index = indexes.find { |i| i[:name] == row } return pull_out_attr from: index end nil end |
#process(row) ⇒ Object
7 8 9 10 |
# File 'lib/clienteer/digesters/indexes_clean_up.rb', line 7 def process(row) row["health_profile"] = get_index("health_profile", row: row) row["blood_work"] = get_index("blood_work", row: row) end |