lib/floe/workflow.rb in floe-0.9.0 vs lib/floe/workflow.rb in floe-0.10.0
- old
+ new
@@ -83,11 +83,11 @@
ensure
wait_thread&.kill
end
end
- attr_reader :context, :credentials, :payload, :states, :states_by_name, :start_at, :name
+ attr_reader :context, :credentials, :payload, :states, :states_by_name, :start_at, :name, :comment
def initialize(payload, context = nil, credentials = {}, name = nil)
payload = JSON.parse(payload) if payload.kind_of?(String)
credentials = JSON.parse(credentials) if credentials.kind_of?(String)
context = Context.new(context) unless context.kind_of?(Context)
@@ -98,9 +98,10 @@
@name = name
@payload = payload
@context = context
@credentials = credentials || {}
+ @comment = payload["Comment"]
@start_at = payload["StartAt"]
@states = payload["States"].to_a.map { |state_name, state| State.build!(self, state_name, state) }
@states_by_name = @states.each_with_object({}) { |state, result| result[state.name] = state }