class Tufy::Fields::ContactNumber::BuildContactNumberField

Constants

NULL_CONTACT_NUMBER

When raw_data.blank? we use NULL_CONTACT_NUMBER instead

Private Class Methods

transform(ctx) click to toggle source
# File lib/tufy/fields/contact_number/build_contact_number_field.rb, line 20
def self.transform(ctx)
  raw_data = ctx.raw_data

  contact_number = if raw_data[:contact_number].empty?
                     NULL_CONTACT_NUMBER
                   else
                    raw_data[:contact_number]
                   end

  BuildContactNumberSegment::Constants::CONTACT_NUMBER_TAG +
    FormatStrings::F2TS % remove_special_characters(contact_number).size +
      remove_special_characters(contact_number)
end