Sha256: 5c8315babdc1f358f5ecf8ac8e93dadf218134d4934183f6f9e5a8a8d56f1da5

Contents?: true

Size: 496 Bytes

Versions: 71

Compression:

Stored size: 496 Bytes

Contents

require 'json' unless defined?(::JSON)

module MultiJson
  module Engines
    # Use the JSON gem to encode/decode.
    class JsonGem
      ParseError = ::JSON::ParserError

      def self.decode(string, options = {}) #:nodoc:
        opts = {}
        opts[:symbolize_names] = options[:symbolize_keys]
        string = string.read if string.respond_to?(:read)
        ::JSON.parse(string, opts)
      end

      def self.encode(object) #:nodoc:
        object.to_json
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 4 rubygems

Version Path
vulcan-0.8.2 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.8.1 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.7.0 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.7 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.6 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.5 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.4 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.3 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.8.0 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.7.2 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.2 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.1 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
dirty_history-0.6.0 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.5.4 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.7.1 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.7.0 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb