module Json2Json
Public Class Methods
transform(original, transformation_template)
click to toggle source
# File lib/json2json.rb, line 5 def self.transform(original, transformation_template) t = transformation_template Hash[t.map{|k,v| [k, v.is_a?(Hash) ? self.transform(original, t[k]) : JsonPath.new(v).on(original.to_json)[0]] }] end