Sha256: a4c36e23a20dcfdff0774ed7f141ff81ff189f36b69fb0caa069edbff6c0f26e

Contents?: true

Size: 601 Bytes

Versions: 2

Compression:

Stored size: 601 Bytes

Contents

module Tufy
  module Fields
    module Account
      class BuildAccountNumberField < 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::ACCOUNT_NUMBER_TAG +
            FormatStrings::F2TS % raw_data[:account_number].to_s.size +
            raw_data[:account_number].to_s
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tufy-0.0.8 lib/tufy/fields/account/build_account_number_field.rb
tufy-0.0.7 lib/tufy/fields/account/build_account_number_field.rb