### Home Classes Methods

### In Files

- lib/yui/compressor.rb

### Parent

YUI::Compressor

### Methods

- ::new

### Class/Module Index

Quicksearch

- YUI
- YUI::Compressor
- YUI::Compressor::Error
- YUI::Compressor::OptionError
- YUI::Compressor::RuntimeError
- YUI::CssCompressor
- YUI::JavaScriptCompressor

No matching classes.

# YUI::JavaScriptCompressor

### Public Class Methods

new(options = {}) click to toggle source

Creates a new YUI::JavaScriptCompressor for minifying JavaScript code.

Options are:

`:charset` | Specifies the character encoding to use. Defaults to `"utf-8"`.
`:line_break` | By default, JavaScript will be compressed onto a single line. Use this option to specify the maximum number of characters in each line before a newline is added. If `:line_break` is 0, a newline is added after each JavaScript statement.
`:munge` | Specifies whether YUI Compressor should shorten local variable names when possible. Defaults to `false`.
`:optimize` | Specifies whether YUI Compressor should optimize JavaScript object property access and object literal declarations to use as few characters as possible. Defaults to `true`.
`:preserve_semicolons` | Defaults to `false`. If `true`, YUI Compressor will ensure semicolons exist after each statement to appease tools like JSLint.

    # File lib/yui/compressor.rb, line 199
    def initialize(options = {})
      super
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.