Class: Keepr::GroupsCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/keepr/groups_creator.rb

Instance Method Summary collapse

Constructor Details

#initialize(target) ⇒ GroupsCreator

Returns a new instance of GroupsCreator.

Raises:

  • (ArgumentError)


3
4
5
6
7
# File 'lib/keepr/groups_creator.rb', line 3

def initialize(target)
  raise ArgumentError unless [ :balance, :profit_and_loss ].include?(target)

  @target = target
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
# File 'lib/keepr/groups_creator.rb', line 9

def run
  case @target
  when :balance then
    load 'asset.txt', :target => :asset
    load 'liability.txt', :target => :liability
  when :profit_and_loss
    load 'profit_and_loss.txt', :target => :profit_and_loss
  end
end