lib/floe/workflow/context.rb in floe-0.10.0 vs lib/floe/workflow/context.rb in floe-0.11.0

- old
+ new

@@ -3,11 +3,13 @@ module Floe class Workflow class Context # @param context [Json|Hash] (default, create another with input and execution params) # @param input [Hash] (default: {}) - def initialize(context = nil, input: {}) + def initialize(context = nil, input: nil) context = JSON.parse(context) if context.kind_of?(String) + + input ||= {} input = JSON.parse(input) if input.kind_of?(String) @context = context || {} self["Execution"] ||= {} self["Execution"]["Input"] ||= input