Class: Rledger::Reconciliation

Inherits:
Object
  • Object
show all
Defined in:
lib/rledger/ledger/reconciliation.rb

Overview

Reconciliation maintains the reconciliation status of a Transaction

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#statusObject (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

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


26
27
28
# File 'lib/rledger/ledger/reconciliation.rb', line 26

def reconciled?
  @status == '*'
end

#to_sObject



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

Returns:

  • (Boolean)


34
35
36
# File 'lib/rledger/ledger/reconciliation.rb', line 34

def unknown?
  @status == ''
end