Module: RVGP::Pta::AvailabilityHelper

Included in:
Application::Config, Base::Grid, Base::Grid, Base::Validation
Defined in:
lib/rvgp/pta.rb

Overview

This module is intended for use in classes that wish to provide #ledger, #hledger, and #pta methods, to its instances.

Instance Method Summary collapse

Instance Method Details

#hledgerRVGP::Pta::HLedger

Return a new instance of RVGP::Pta::HLedger

Returns:



22
23
24
# File 'lib/rvgp/pta.rb', line 22

def hledger
  RVGP::Pta.hledger
end

#ledgerRVGP::Pta::Ledger

Return a new instance of RVGP::Pta::Ledger

Returns:



17
18
19
# File 'lib/rvgp/pta.rb', line 17

def ledger
  RVGP::Pta.ledger
end

#ptaRVGP::Pta::Ledger, RVGP::Pta::HLedger

Depending on what’s installed and configured, a pta adapter is returned. The rules that govern what adapter is choosen, works like this:

  1. If RVGP::Pta.pta_adapter= has been set, then, this adapter will be returned.

  2. If ledger is installed on the system, then ledger is returned

  3. If hledger is installed on the system, then hledger is returned

If no pta adapters are available, an error is raised.



27
28
29
# File 'lib/rvgp/pta.rb', line 27

def pta
  RVGP::Pta.pta
end