Class: RVGP::Pta::RegisterPosting
- Inherits:
-
Base::Reader
- Object
- Base::Reader
- RVGP::Pta::RegisterPosting
- Defined in:
- lib/rvgp/pta.rb
Overview
A posting, as output by the ‘register’ command. Typically these are available as items in a transaction, via the RVGP::Pta::RegisterTransaction#postings method.
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
The account this posting was assigned to.
-
#amounts ⇒ Array<RVGP::Journal::Commodity>
readonly
The commodities that were encountered in the amount column.
-
#tags ⇒ Hash<String,<String,TrueClass>>
readonly
A hash containing the tags that were encountered in this posting.
-
#totals ⇒ Array<RVGP::Journal::Commodity>
readonly
The commodities that were encountered in the total column.
Attributes inherited from Base::Reader
Instance Method Summary collapse
-
#amount_in(code) ⇒ RVGP::Journal::Commodity
This method will return the sum of all commodities in the amount column, in the specified currency.
-
#total_in(code) ⇒ RVGP::Journal::Commodity
This method will return the sum of all commodities in the total column, in the specified currency.
Methods inherited from Base::Reader
Instance Attribute Details
#account ⇒ String (readonly)
The account this posting was assigned to
61 62 63 |
# File 'lib/rvgp/pta.rb', line 61 def account @account end |
#amounts ⇒ Array<RVGP::Journal::Commodity> (readonly)
The commodities that were encountered in the amount column
61 62 63 |
# File 'lib/rvgp/pta.rb', line 61 def amounts @amounts end |
#tags ⇒ Hash<String,<String,TrueClass>> (readonly)
A hash containing the tags that were encountered in this posting. Values are either the string that was encountered, for this tag. Or, true, if no specific string value was assigned
61 62 63 |
# File 'lib/rvgp/pta.rb', line 61 def @tags end |
#totals ⇒ Array<RVGP::Journal::Commodity> (readonly)
The commodities that were encountered in the total column
61 62 63 |
# File 'lib/rvgp/pta.rb', line 61 def totals @totals end |
Instance Method Details
#amount_in(code) ⇒ RVGP::Journal::Commodity
This method will return the sum of all commodities in the amount column, in the specified currency.
67 68 69 |
# File 'lib/rvgp/pta.rb', line 67 def amount_in(code) commodities_sum amounts, code end |
#total_in(code) ⇒ RVGP::Journal::Commodity
This method will return the sum of all commodities in the total column, in the specified currency.
74 75 76 |
# File 'lib/rvgp/pta.rb', line 74 def total_in(code) commodities_sum totals, code end |