    # File lib/yajl/json_gem/encoding.rb, line 19
      def self.generate(obj, opts={})
        begin
          options_map = {}
          if opts.has_key?(:indent)
            options_map[:pretty] = true
            options_map[:indent] = opts[:indent]
          end
          Yajl::Encoder.encode(obj, options_map)
        rescue Yajl::EncodeError => e
          raise JSON::GeneratorError, e.message
        end
      end