# ri > Sass::Engine

---
type: CommandReference
command: Sass::Engine
mode: ri
section: 
source: ri
---
## Quick Reference

- `Sass::Engine.new(template, options={})` — create a new engine
- `engine.render` — compile Sass template to CSS
- `engine.render_with_sourcemap` — compile with source map
- `engine.to_css` — alias for render
- `engine.to_tree` — get parsed syntax tree
- `Sass::Engine.for_file(file, options)` — create engine from file
- `Sass::Engine.normalize_options(options)` — normalize options hash
- `Sass::Engine.parse_interp(interp, base)` — parse interpolation

## Name

**Sass::Engine** — This class handles the parsing and compilation of the Sass template.

## Synopsis

ruby
template = File.read('stylesheets/sassy.sass')
engine = Sass::Engine.new(template, options)
output = engine.render
## Options (Constants, Methods & Attributes)

### Constants

- `COMMENT_CHAR` — The character that designates the beginning of a comment (Sass or CSS).
- `CONTENT_RE` — [not documented]
- `CSS_COMMENT_CHAR` — The character that follows `COMMENT_CHAR` and designates a CSS comment.
- `DEFAULT_OPTIONS` — The default options for `Sass::Engine`. @api public
- `DIRECTIVES` — [not documented]
- `DIRECTIVE_CHAR` — The character used to denote a compiler directive.
- `ESCAPE_CHAR` — Designates a non-parsed rule.
- `FUNCTION_RE` — [not documented]
- `MIXIN_DEFINITION_CHAR` — Designates block as mixin definition.
- `MIXIN_DEF_RE` — [not documented]
- `MIXIN_INCLUDE_CHAR` — Includes named mixin declared using `MIXIN_DEFINITION_CHAR`.
- `MIXIN_INCLUDE_RE` — [not documented]
- `PROPERTY_CHAR` — The character that begins a CSS property.
- `PROPERTY_OLD` — The regex that matches and extracts data from properties of the form `:name prop`.
- `SASS_COMMENT_CHAR` — The character that follows `COMMENT_CHAR` and designates a Sass comment (not output in CSS).
- `SASS_LOUD_COMMENT_CHAR` — The character that indicates a comment allows interpolation and should be preserved in `:compressed` mode.

### Class Methods

- `for_file(file, options)` — Create engine from a file.
- `new(template, options={})` — Create a new engine.
- `normalize_options(options)` — Normalize options hash.
- `parse_interp(interp, base)` — Parse interpolation.

### Instance Methods

- `_dependencies` — [not documented]
- `dependencies` — [not documented]
- `options` — Returns the options hash (also attr_reader).
- `render` — Compile Sass template to CSS.
- `render_with_sourcemap` — Compile with source map.
- `source_encoding` — Returns the source encoding.
- `to_css` — Alias for `render`.
- `to_tree` — Returns the parsed syntax tree.

### Attributes

- `attr_reader options` — The options hash.

## Examples

ruby
template = File.read('stylesheets/sassy.sass')
sass_engine = Sass::Engine.new(template)
output = sass_engine.render
puts output
## See Also

- [Sass::Engine](http://localhost/phpMan.php/perldoc/Sass%3A%3AEngine/markdown) (original documentation)