Sha256: b7e612e20c154e4df068db0d9d3bc27cd94e764010d091baaf936710cff012da

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

module Tufy
  module Fields
    module ContactNumber
      class BuildContactNumberField < BuildField
        expects :raw_data
        promises :transformed_data

        executed do |ctx|
          ctx.transformed_data =
            ctx.transformed_data +
            transform(ctx).upcase
        end

        private

        def self.transform(ctx)
          raw_data = ctx.raw_data

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tufy-0.0.8 lib/tufy/fields/contact_number/build_contact_number_field.rb
tufy-0.0.7 lib/tufy/fields/contact_number/build_contact_number_field.rb