Class: Data::New
- Inherits:
-
Object
- Object
- Data::New
- Defined in:
- app/services/flexite/data/new.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(migrator) ⇒ New
constructor
A new instance of New.
Constructor Details
#initialize(migrator) ⇒ New
Returns a new instance of New.
3 4 5 6 7 |
# File 'app/services/flexite/data/new.rb', line 3 def initialize(migrator) @migrator = migrator @errors = Hash.new { |h, k| h[k] = [] } @result = {} end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/services/flexite/data/new.rb', line 9 def call @migrator.call.each do |root, configs| begin @result[root] = save_root(root, configs) rescue => exc @errors[root] << [exc., exc.backtrace] end end @result.tap do |result| result[:errors] = @errors end end |