Sha256: a382cd61d9879ede2c1176c86bc73a65a7a453a0b883276e587b9ec8efc830ad

Contents?: true

Size: 808 Bytes

Versions: 7

Compression:

Stored size: 808 Bytes

Contents

module Rentvine
  class Client
    module Transactions
      def transactions(args = {})
        results = process_request(:get, 'accounting/transactions/search', params: args)
        return results if results.is_a?(RentvineError)

        results.map do |result|
          rvobj = Rentvine::Transaction.new(result[:transaction])
          rvobj.ledger = Rentvine::Ledger.new(result[:ledger])
          rvobj.portfolio = Rentvine::Portfolio.new(result[:portfolio])
          rvobj.unit = Rentvine::Unit.new(result[:unit])
          rvobj.transaction_entries = Rentvine::TransactionEntry.new(result[:transaction_entries])
          rvobj.meta = { appends: [:ledger, :portfolio, :unit, :transaction_entries] }
          rvobj
        end
      end
      alias list_transactions transactions
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rentvine-0.4.0 lib/rentvine/client/transactions.rb
rentvine-0.3.3 lib/rentvine/client/transactions.rb
rentvine-0.3.2 lib/rentvine/client/transactions.rb
rentvine-0.3.1 lib/rentvine/client/transactions.rb
rentvine-0.3.0 lib/rentvine/client/transactions.rb
rentvine-0.2.0 lib/rentvine/client/transactions.rb
rentvine-0.1.0 lib/rentvine/client/transactions.rb