Class: PgLedger::EntryBuilder
- Inherits:
-
Object
- Object
- PgLedger::EntryBuilder
- Defined in:
- lib/pg_ledger/entry_builder.rb
Defined Under Namespace
Classes: Leg
Instance Attribute Summary collapse
-
#legs ⇒ Object
readonly
Returns the value of attribute legs.
Instance Method Summary collapse
- #credit(account, amount) ⇒ Object
- #debit(account, amount) ⇒ Object
-
#initialize ⇒ EntryBuilder
constructor
A new instance of EntryBuilder.
Constructor Details
#initialize ⇒ EntryBuilder
Returns a new instance of EntryBuilder.
9 10 11 |
# File 'lib/pg_ledger/entry_builder.rb', line 9 def initialize @legs = [] end |
Instance Attribute Details
#legs ⇒ Object (readonly)
Returns the value of attribute legs.
7 8 9 |
# File 'lib/pg_ledger/entry_builder.rb', line 7 def legs @legs end |
Instance Method Details
#credit(account, amount) ⇒ Object
17 18 19 |
# File 'lib/pg_ledger/entry_builder.rb', line 17 def credit(account, amount) add(:credit, account, amount) end |
#debit(account, amount) ⇒ Object
13 14 15 |
# File 'lib/pg_ledger/entry_builder.rb', line 13 def debit(account, amount) add(:debit, account, amount) end |