Class: Judges::Join

Inherits:
Object show all
Defined in:
lib/judges/commands/join.rb

Overview

Join.

Author

Yegor Bugayenko (yegor256@gmail.com)

Copyright

Copyright © 2024 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Constructor Details

#initialize(loog) ⇒ Join

Returns a new instance of Join.



31
32
33
# File 'lib/judges/commands/join.rb', line 31

def initialize(loog)
  @loog = loog
end

Instance Method Details

#run(_opts, args) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/judges/commands/join.rb', line 35

def run(_opts, args)
  raise 'Exactly two arguments required' unless args.size == 2
  master = Judges::Impex.new(@loog, args[0])
  slave = Judges::Impex.new(@loog, args[1])
  fb = master.import
  slave.import_to(fb)
  master.export(fb)
  @loog.info('Two factbases joined')
end