Sha256: 353a74917a11c389a8cda2aa8edb94ec93558971067a6fc40876e9fe9e0048d8

Contents?: true

Size: 501 Bytes

Versions: 13

Compression:

Stored size: 501 Bytes

Contents

require 'json'

module BEL::Extension::Format
  module JSONImplementation

    class JSONReader
      def initialize(data)
        @data = data
      end

      def each(&block)
        if block_given?
          JSON.load(@data, nil, :symbolize_names => true).each do |obj|
            yield obj
          end
        else
          to_enum(:each)
        end
      end
    end

    class JSONWriter

      def write_json_object(json_object)
        JSON.dump(json_object)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bel-0.3.3-x64-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.3-x86-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.3 lib/bel/extensions/json/ruby_json.rb
bel-0.3.2-x64-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.2-x86-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.2 lib/bel/extensions/json/ruby_json.rb
bel-0.3.1-x64-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.1-x86-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.1 lib/bel/extensions/json/ruby_json.rb
bel-0.3.0-x86-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.0-x64-mingw32 lib/bel/extensions/json/ruby_json.rb
bel-0.3.0 lib/bel/extensions/json/ruby_json.rb
bel-0.3.0.beta6 lib/bel/extensions/json/ruby_json.rb