Sha256: 1b82e8f6b7f1ff860c40f4a71bf91e0d0711c4c22e55c9a34785f59624d47244

Contents?: true

Size: 489 Bytes

Versions: 3

Compression:

Stored size: 489 Bytes

Contents

module RockRMS
  module Responses
    class RecurringDonationDetails
      MAP = {
        fund_id: 'AccountId',
        amount: 'Amount'
      }.freeze

      def self.format(data)
        if data.is_a?(Array)
          data.map { |object| format_single(object) }
        else
          format_single(data)
        end
      end

      def self.format_single(data)
        MAP.each.with_object({}) do |(l, r), object|
          object[l] = data[r]
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rock_rms-2.0.0 lib/rock_rms/responses/recurring_donation_details.rb
rock_rms-1.3.0 lib/rock_rms/responses/recurring_donation_details.rb
rock_rms-1.2.0 lib/rock_rms/responses/recurring_donation_details.rb