Sha256: a43b33c941a5911e43f30f47837448250a1fd68b347e72f6f3a23f5954a2c3b2

Contents?: true

Size: 624 Bytes

Versions: 5

Compression:

Stored size: 624 Bytes

Contents

module Tufy
  module Fields
    module ContactNumber
      class BuildContactNumberTypeField < 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_TYPE_TAG +
            FormatStrings::F2TS % raw_data[:contact_number_type].size +
              raw_data[:contact_number_type]
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tufy-0.0.13 lib/tufy/fields/contact_number/build_contact_number_type_field.rb
tufy-0.0.12 lib/tufy/fields/contact_number/build_contact_number_type_field.rb
tufy-0.0.11 lib/tufy/fields/contact_number/build_contact_number_type_field.rb
tufy-0.0.10 lib/tufy/fields/contact_number/build_contact_number_type_field.rb
tufy-0.0.9 lib/tufy/fields/contact_number/build_contact_number_type_field.rb