Sha256: fb7fe67a3eb3d233be799b8c491f283b786de9340dfbd84ad87d627302cd08f6

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module Tufy
  module Fields
    module Account
      class BuildPartialPaymentField < 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::PARTIAL_PAYMENT_TAG +
            FormatStrings::F2TS % raw_data[:partial_payment].size +
            raw_data[:partial_payment]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tufy-0.0.7 lib/tufy/fields/account/build_partial_payment_field.rb