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.6.1 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
vulcan-0.6.0 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.5.0 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
dirty_history-0.5.3 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.5.2 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
vulcan-0.4.0 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.5.1 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
dirty_history-0.5.0 dirty_history/ruby/1.9.1/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.3.0 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/multi_json/lib/multi_json/engines/json_gem.rb
vulcan-0.2.5 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.2.4 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.2.3 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb
vulcan-0.2.2 server/vendor/gems/gems/multi_json-1.0.3/lib/multi_json/engines/json_gem.rb