Class: YDIM::Reconciler::Match
- Inherits:
-
Object
- Object
- YDIM::Reconciler::Match
- Defined in:
- lib/ydim/reconciler.rb
Overview
One bank entry and the invoices it was matched to.
Instance Attribute Summary collapse
-
#applied ⇒ Object
Returns the value of attribute applied.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#invoices ⇒ Object
readonly
Returns the value of attribute invoices.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #applicable? ⇒ Boolean
- #applied? ⇒ Boolean
-
#initialize(entry, invoices, state, reason = nil) ⇒ Match
constructor
A new instance of Match.
- #invoice_ids ⇒ Object
-
#review? ⇒ Boolean
Matched, but not well enough to book automatically.
Constructor Details
#initialize(entry, invoices, state, reason = nil) ⇒ Match
Returns a new instance of Match.
48 49 50 51 52 53 54 |
# File 'lib/ydim/reconciler.rb', line 48 def initialize(entry, invoices, state, reason = nil) @entry = entry @invoices = invoices @state = state @reason = reason @applied = false end |
Instance Attribute Details
#applied ⇒ Object
Returns the value of attribute applied.
47 48 49 |
# File 'lib/ydim/reconciler.rb', line 47 def applied @applied end |
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
46 47 48 |
# File 'lib/ydim/reconciler.rb', line 46 def entry @entry end |
#invoices ⇒ Object (readonly)
Returns the value of attribute invoices.
46 47 48 |
# File 'lib/ydim/reconciler.rb', line 46 def invoices @invoices end |
#reason ⇒ Object
Returns the value of attribute reason.
47 48 49 |
# File 'lib/ydim/reconciler.rb', line 47 def reason @reason end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
46 47 48 |
# File 'lib/ydim/reconciler.rb', line 46 def state @state end |
Instance Method Details
#applicable? ⇒ Boolean
55 56 57 |
# File 'lib/ydim/reconciler.rb', line 55 def applicable? APPLICABLE.include?(@state) end |
#applied? ⇒ Boolean
62 63 64 |
# File 'lib/ydim/reconciler.rb', line 62 def applied? @applied end |
#invoice_ids ⇒ Object
65 66 67 |
# File 'lib/ydim/reconciler.rb', line 65 def invoice_ids @invoices.collect { |info| info.unique_id } end |
#review? ⇒ Boolean
Matched, but not well enough to book automatically.
59 60 61 |
# File 'lib/ydim/reconciler.rb', line 59 def review? !applicable? && !@invoices.empty? end |