Class: Ookkee::BuilderProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/ookkee/builder_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BuilderProxy

Returns a new instance of BuilderProxy.



3
4
5
# File 'lib/ookkee/builder_proxy.rb', line 3

def initialize(options)
  @builder = options[:builder]
end

Instance Method Details

#credit(account) {|factory| ... } ⇒ Object

Yields:

  • (factory)


7
8
9
10
11
12
13
14
15
# File 'lib/ookkee/builder_proxy.rb', line 7

def credit()
  factory = Factory.new
  yield factory
  factory.entry_type 'credit'
  factory. 
  factory.sheet_name .sheet_name

  @builder.registry << factory
end

#debit(account) {|factory| ... } ⇒ Object

Yields:

  • (factory)


17
18
19
20
21
22
23
24
25
# File 'lib/ookkee/builder_proxy.rb', line 17

def debit()
  factory = Factory.new
  yield factory
  factory.entry_type 'debit'
  factory. 
  factory.sheet_name .sheet_name

  @builder.registry << factory
end