Class: Bulkrax::SampleCsvService::SplitFormatter

Inherits:
Object
  • Object
show all
Defined in:
app/services/bulkrax/sample_csv_service/split_formatter.rb

Overview

Formats split pattern descriptions

Instance Method Summary collapse

Instance Method Details

#format(split_value) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'app/services/bulkrax/sample_csv_service/split_formatter.rb', line 6

def format(split_value)
  return "Property does not split." if split_value.nil?

  if split_value == true
    parse_pattern(Bulkrax.multi_value_element_split_on.source)
  elsif split_value.is_a?(String)
    parse_pattern(split_value)
  else
    split_value
  end
end