Sha256: 6fed0ca0f58b0d79c52390787ac4fd6ce234e487e7b2768c1e6c1fa5c5b9c31b

Contents?: true

Size: 642 Bytes

Versions: 15

Compression:

Stored size: 642 Bytes

Contents

require 'multi_json'
MultiJson.engine # Force loading of an engine
require 'riak/core_ext/json'

module Riak
  class << self
    # Options that will be passed to the JSON parser and encoder.
    # Defaults to {:max_nesting => 20}
    attr_accessor :json_options
  end
  self.json_options = {:max_nesting => 20}

  # JSON module for internal use inside riak-client
  module JSON
    class << self
      # Parse a JSON string
      def parse(str)
        MultiJson.decode(str, Riak.json_options)
      end

      # Generate a JSON string
      def encode(obj)
        MultiJson.encode(obj)
      end
      alias :dump :encode
    end
  end
end

Version data entries

15 entries across 5 versions & 2 rubygems

Version Path
riak-client-1.0.3 pkg/riak-client-1.0.2/pkg/riak-client-1.0.0/lib/riak/json.rb
riak-client-1.0.3 pkg/riak-client-1.0.2/pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/lib/riak/json.rb
riak-client-1.0.3 pkg/riak-client-1.0.1/lib/riak/json.rb
riak-client-1.0.3 pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/lib/riak/json.rb
riak-client-1.0.3 pkg/riak-client-1.0.2/lib/riak/json.rb
riak-client-1.0.3 pkg/riak-client-1.0.2/pkg/riak-client-1.0.1/lib/riak/json.rb
riak-client-1.0.3 lib/riak/json.rb
riak-client-1.0.3 pkg/riak-client-1.0.0/lib/riak/json.rb
riak-client-1.0.2 lib/riak/json.rb
riak-client-1.0.2 pkg/riak-client-1.0.0/lib/riak/json.rb
riak-client-1.0.2 pkg/riak-client-1.0.1/lib/riak/json.rb
riak-client-1.0.2 pkg/riak-client-1.0.1/pkg/riak-client-1.0.0/lib/riak/json.rb
riak-client-1.0.0 lib/riak/json.rb
seomoz-riak-client-1.0.0.pre lib/riak/json.rb
riak-client-1.0.0.beta lib/riak/json.rb