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