Class: PgLedger::EntryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_ledger/entry_builder.rb

Defined Under Namespace

Classes: Leg

Instance Attribute Summary collapse

Instance Method Summary collapse

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(, amount)
  add(:credit, , amount)
end

#debit(account, amount) ⇒ Object



13
14
15
# File 'lib/pg_ledger/entry_builder.rb', line 13

def debit(, amount)
  add(:debit, , amount)
end