Class: Rledger::Reconciliation
- Inherits:
-
Object
- Object
- Rledger::Reconciliation
- Defined in:
- lib/rledger/ledger/reconciliation.rb
Overview
Reconciliation maintains the reconciliation status of a Transaction
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #discarded! ⇒ Object
- #discarded? ⇒ Boolean
- #parse(s) ⇒ Object
- #pending! ⇒ Object
- #pending? ⇒ Boolean
- #reconciled! ⇒ Object
- #reconciled? ⇒ Boolean
- #to_s ⇒ Object
- #unknown! ⇒ Object
- #unknown? ⇒ Boolean
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/rledger/ledger/reconciliation.rb', line 4 def status @status end |
Instance Method Details
#discarded! ⇒ Object
14 15 16 |
# File 'lib/rledger/ledger/reconciliation.rb', line 14 def discarded! @status = '?' end |
#discarded? ⇒ Boolean
18 19 20 |
# File 'lib/rledger/ledger/reconciliation.rb', line 18 def discarded? @status == '?' end |
#parse(s) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/rledger/ledger/reconciliation.rb', line 42 def parse(s) case s when "*" then reconciled! when "!" then pending! when "?" then discarded! when "" then unknown! else unknown! end end |
#pending! ⇒ Object
6 7 8 |
# File 'lib/rledger/ledger/reconciliation.rb', line 6 def pending! @status = '!' end |
#pending? ⇒ Boolean
10 11 12 |
# File 'lib/rledger/ledger/reconciliation.rb', line 10 def pending? @status == '!' end |
#reconciled! ⇒ Object
22 23 24 |
# File 'lib/rledger/ledger/reconciliation.rb', line 22 def reconciled! @status = '*' end |
#reconciled? ⇒ Boolean
26 27 28 |
# File 'lib/rledger/ledger/reconciliation.rb', line 26 def reconciled? @status == '*' end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/rledger/ledger/reconciliation.rb', line 38 def to_s @status end |
#unknown! ⇒ Object
30 31 32 |
# File 'lib/rledger/ledger/reconciliation.rb', line 30 def unknown! @status = '' end |
#unknown? ⇒ Boolean
34 35 36 |
# File 'lib/rledger/ledger/reconciliation.rb', line 34 def unknown? @status == '' end |