Class: Keepr::GroupsCreator
- Inherits:
-
Object
- Object
- Keepr::GroupsCreator
- Defined in:
- lib/keepr/groups_creator.rb
Instance Method Summary collapse
-
#initialize(target) ⇒ GroupsCreator
constructor
A new instance of GroupsCreator.
- #run ⇒ Object
Constructor Details
#initialize(target) ⇒ GroupsCreator
Returns a new instance of GroupsCreator.
4 5 6 7 8 |
# File 'lib/keepr/groups_creator.rb', line 4 def initialize(target) raise ArgumentError unless %i[balance profit_and_loss].include?(target) @target = target end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/keepr/groups_creator.rb', line 10 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 |