Sha256: cf141a40a45c88b833ac2c5faf2de914a46646348018ef7c0b70a22ede122489

Contents?: true

Size: 622 Bytes

Versions: 3

Compression:

Stored size: 622 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

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