Sha256: a779b5ba377dd2a8fcd62a3b7c726ba21f9aa6d1561285a1a48fd3c60b7b8821

Contents?: true

Size: 311 Bytes

Versions: 1

Compression:

Stored size: 311 Bytes

Contents

require "json2json/version"
require "json"
require "jsonpath"
module Json2Json
  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

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
json2json-0.0.1 lib/json2json.rb