lib/floe/workflow/reference_path.rb in floe-0.1.1 vs lib/floe/workflow/reference_path.rb in floe-0.2.0

- old
+ new

@@ -2,11 +2,11 @@ module Floe class Workflow class ReferencePath < Path class << self - def set (payload, context, value) + def set(payload, context, value) new(payload).set(context, value) end end def initialize(*) @@ -22,10 +22,10 @@ result = context.dup path = JsonPath.new(payload) .path[1..] .map { |v| v.match(/\[(?<name>.+)\]/)["name"] } - .map { |v| v[0] == "'" ? v.gsub("'", "") : v.to_i } + .map { |v| v[0] == "'" ? v.delete("'") : v.to_i } .compact # If the payload is '$' then merge the value into the context # otherwise use store path to set the value to a sub-key #