Class: Formatador

Inherits:
Object
  • Object
show all
Defined in:
lib/ftl/formatador_table.rb

Overview

Monkey patch this fix until Formatador 0.2.3 is released

Instance Method Summary collapse

Instance Method Details

#calculate_datum(header, hash) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ftl/formatador_table.rb', line 3

def calculate_datum(header, hash)
  if !hash.keys.include?(header) && (splits = header.to_s.split('.')).length > 1
    datum = nil
    splits.each do |split|
      d = (datum||hash)
      datum = d[split] || d[split.to_sym] || ''
    end
  else
    datum = hash[header] || ''
  end
  datum
end