INNER CODE UNIT · Ruby

parse_json

Shopify/krane · lib/krane/bindings_parser.rb:56

    def parse_json(string)
      bindings = JSON.parse(string)

      unless bindings.is_a?(Hash)
        raise ArgumentError, "Expected JSON data to be a hash."
      end

      bindings
    rescue JSON::ParserError
      nil
    end

    def parse_csv(string)
      lines = CSV.parse(string)
      bindings = {}

      lines.each do |line|
        line.each do |binding|

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…