Sha256: df89996ec585c4ead61afb7ba1070a7bd29ae50930551f45fe12cd99ad51424d

Contents?: true

Size: 614 Bytes

Versions: 7

Compression:

Stored size: 614 Bytes

Contents

module Tufy
  module Fields
    module Account
      class BuildPastDueAmountField < 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::PAST_DUE_AMOUNT_TAG +
            FormatStrings::F2TS % raw_data[:past_due_amount].to_i.to_s.size +
            raw_data[:past_due_amount].to_i.to_s
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tufy-0.0.13 lib/tufy/fields/account/build_past_due_amount_field.rb
tufy-0.0.12 lib/tufy/fields/account/build_past_due_amount_field.rb
tufy-0.0.11 lib/tufy/fields/account/build_past_due_amount_field.rb
tufy-0.0.10 lib/tufy/fields/account/build_past_due_amount_field.rb
tufy-0.0.9 lib/tufy/fields/account/build_past_due_amount_field.rb
tufy-0.0.8 lib/tufy/fields/account/build_past_due_amount_field.rb
tufy-0.0.7 lib/tufy/fields/account/build_past_due_amount_field.rb