Module: MudratProjector::TransactionEntry::Factory

Included in:
MudratProjector::TransactionEntry
Defined in:
lib/mudrat_projector/transaction_entry.rb

Instance Method Summary collapse

Instance Method Details

#new(params = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/mudrat_projector/transaction_entry.rb', line 6

def new params = {}
  catch :instance do
    maybe_build_new_fixed_entry params
    maybe_build_new_percentage_entry params
    super
  end
end

#new_credit(params = {}) ⇒ Object



14
15
16
17
# File 'lib/mudrat_projector/transaction_entry.rb', line 14

def new_credit params = {}
  params = { credit_or_debit: :credit }.merge params
  new params
end

#new_debit(params = {}) ⇒ Object



19
20
21
22
# File 'lib/mudrat_projector/transaction_entry.rb', line 19

def new_debit params = {}
  params = { credit_or_debit: :debit }.merge params
  new params
end