Sha256: f2e71919b6a28520034a9856a54bdee626a2e77dd4ae62436250ad2ff5095db0

Contents?: true

Size: 702 Bytes

Versions: 5

Compression:

Stored size: 702 Bytes

Contents

module Tufy
  module Fields
    module Account
      class BuildRestructuredAccountNumberField < 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

          BuildAccountSegment::Constants::RESTRUCTURED_ACCOUNT_NUMBER_TAG +
            FormatStrings::F2TS % (FormatStrings::F20TS % raw_data[:restructured_account_number]).to_s.size +
              FormatStrings::F20TS % raw_data[:restructured_account_number].to_s
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tufy-0.0.13 lib/tufy/fields/account/build_restructured_account_number_field.rb
tufy-0.0.12 lib/tufy/fields/account/build_restructured_account_number_field.rb
tufy-0.0.11 lib/tufy/fields/account/build_restructured_account_number_field.rb
tufy-0.0.10 lib/tufy/fields/account/build_restructured_account_number_field.rb
tufy-0.0.9 lib/tufy/fields/account/build_restructured_account_number_field.rb