Module: SampleManifestExcel::Upload::Converters

Included in:
Data, Row
Defined in:
app/sample_manifest_excel/sample_manifest_excel/upload/converters.rb

Constant Summary collapse

BLANK_CHARS =
'[ \u00A0]'

Instance Method Summary collapse

Instance Method Details

#strip_all_blanks(obj) ⇒ Object


8
9
10
11
12
13
14
# File 'app/sample_manifest_excel/sample_manifest_excel/upload/converters.rb', line 8

def strip_all_blanks(obj)
  if obj.respond_to?(:match)
    obj.match(/^(#{Converters::BLANK_CHARS}*)(.*?)(#{Converters::BLANK_CHARS}*)$/)[2]
  else
    obj
  end
end