Class: ProconBypassMan::Procon::MacroBuilder::SubjectMerger

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/procon/macro_builder.rb

Class Method Summary collapse

Class Method Details

.merge(subjects) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/procon_bypass_man/procon/macro_builder.rb', line 5

def self.merge(subjects)
  if subjects.size == 1
    return subjects.first.to_steps
  end

  subjects.inject([[], []]) do |acc, item|
    acc[0] << item.to_steps[0]
    acc[1] << item.to_steps[1]
    acc
  end
end