Sha256: a602765ea266258d20780ff43a06870233d5b9a43d39cd85272dd0be98158e28

Contents?: true

Size: 631 Bytes

Versions: 2

Compression:

Stored size: 631 Bytes

Contents

module Tufy
  module Fields
    module Account
      class BuildOutstandingBalanceField < 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::OUTSTANDING_BALANCE_TAG +
            FormatStrings::F2TS % raw_data[:outstanding_balance].to_i.to_s.size +
            raw_data[:outstanding_balance].to_i.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_outstanding_balance_field.rb
tufy-0.0.7 lib/tufy/fields/account/build_outstanding_balance_field.rb