Sha256: 052ad8db2744c206909630a1799c9b53fa98b01b47fb60833472e9a4982703d3

Contents?: true

Size: 313 Bytes

Versions: 5

Compression:

Stored size: 313 Bytes

Contents

require 'json'

module Vedeu
  class JSONParser
    def self.parse(json)
      new(json).parse
    end

    def initialize(json)
      @json = json
    end

    def parse
      JSON.load(json, nil, symbolize_names: true)
    rescue JSON::ParserError
      {}
    end

    private

    attr_reader :json
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.1.6 lib/vedeu/output/json_parser.rb
vedeu-0.1.5 lib/vedeu/output/json_parser.rb
vedeu-0.1.4 lib/vedeu/output/json_parser.rb
vedeu-0.1.3 lib/vedeu/output/json_parser.rb
vedeu-0.1.2 lib/vedeu/output/json_parser.rb