Class: Debit

Inherits:
Entry
  • Object
show all
Defined in:
app/models/debit.rb

Instance Method Summary collapse

Methods inherited from Entry

#readonly?

Instance Method Details

#balanced?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/models/debit.rb', line 11

def balanced?
  !credit.nil? and (credit.amount + amount == 0)
end

#sign_conventionObject



7
8
9
# File 'app/models/debit.rb', line 7

def sign_convention
  errors.add(:base, "Debit must be non-positive") unless amount <= 0
end