Sha256: 4381c36dc4f52faa65c9a7106790fbe4bbe81fa8a593b6d548ab379a57778896

Contents?: true

Size: 880 Bytes

Versions: 8

Compression:

Stored size: 880 Bytes

Contents

module ShelbyArena
  module Response
    class Contribution < Base
      MAP = {
        id: 'ContributionId',
        batch_id: 'BatchId',
        amount: 'CurrencyAmount',
        date: 'ContributionDate',
        memo: 'Memo',
        person_id: 'PersonId',
        person: 'PersonInformation',
        transaction_number: 'TransactionNumber',
        currency_type_id: 'CurrencyTypeId',
        currency_type_value: 'CurrencyTypeValue',
        contribution_funds: 'ContributionFunds'
      }.freeze


      def format_single(data)
        response = to_h(MAP, data)
        response[:contribution_funds] = ContributionFund.format(response[:contribution_funds].dig('ContributionFund')) if response[:contribution_funds]
        response[:person] = Person.format(response[:person])
        response[:amount] = response[:amount].to_f
        response
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shelby_arena-0.0.8 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.7 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.6 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.5 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.4 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.3 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.2 lib/shelby_arena/response/contribution.rb
shelby_arena-0.0.1 lib/shelby_arena/response/contribution.rb