Class: JSONCombiner

Inherits:
Object
  • Object
show all
Defined in:
lib/jsoncombiner.rb

Overview

Fields to choose steps to combine Handling for getting input from steps

Instance Method Summary collapse

Constructor Details

#initialize(*inputjsons) ⇒ JSONCombiner

Returns a new instance of JSONCombiner.



10
11
12
# File 'lib/jsoncombiner.rb', line 10

def initialize(*inputjsons)
  @inputjsons = inputjsons
end

Instance Method Details

#concatenateObject

Concatenates JSONs together



15
16
17
18
19
20
21
22
# File 'lib/jsoncombiner.rb', line 15

def concatenate
  savearray = Array.new
  @inputjsons.each do |j|
    savearray = savearray + JSON.parse(j)
  end
  
  return savearray.to_json
end