def to_json
      raise TinyMCEInvalidOptionType.invalid_type_of(plugins, :for => :plugins) unless plugins.is_a?(Array)

      json_options = []
      @options.each_pair do |key, value|
        raise TinyMCEInvalidOption.invalid_option(key) unless valid?(key)
        json_options << "#{key} : " + case value
        when String, Symbol, Fixnum
          "'#{value.to_s}'"
        when Array
          '"' + value.join(',') + '"'
        when TrueClass
          'true'
        when FalseClass
          'false'
        else
          raise TinyMCEInvalidOptionType.invalid_type_of(value, :for => key)
        end
      end

      json_options.sort!

      @raw_options.compact!
      json_options += @raw_options unless @raw_options.blank?

      "{\n" + json_options.delete_if {|o| o.blank? }.join(",\n") + "\n\n}"
    end
def to_json
      raise TinyMCEInvalidOptionType.invalid_type_of(plugins, :for => :plugins) unless plugins.is_a?(Array)

      json_options = []
      @options.each_pair do |key, value|
        raise TinyMCEInvalidOption.invalid_option(key) unless valid?(key)
        json_options << "#{key} : " + case value
        when String, Symbol, Fixnum
          "'#{value.to_s}'"
        when Array
          '"' + value.join(',') + '"'
        when TrueClass
          'true'
        when FalseClass
          'false'
        else
          raise TinyMCEInvalidOptionType.invalid_type_of(value, :for => key)
        end
      end

      json_options.sort!

      @raw_options.compact!
      json_options += @raw_options unless @raw_options.blank?

      "{\n" + json_options.delete_if {|o| o.blank? }.join(",\n") + "\n\n}"
    end
Validate and merge options and raw_options into a string
 to be used for tinyMCE.init() in the raw_tiny_mce_init helper