Module: CoffeeScript

### Home Classes Methods

### In Files

- lib/coffee_script.rb

### Namespace

- MODULE CoffeeScript::Source

### Methods

- ::compile
- ::engine
- ::engine=
- ::version

### Class/Module Index

Quicksearch

- CoffeeScript
- CoffeeScript::Source

No matching classes.

# CoffeeScript

### Constants

CompilationError
EngineError
Error

### Public Class Methods

compile(script, options = {}) click to toggle source

Compile a script (String or IO) to JavaScript.

    # File lib/coffee_script.rb, line 66
    def compile(script, options = {})
      script = script.read if script.respond_to?(:read)

      if options.key?(:bare)
      elsif options.key?(:no_wrap)
        options[:bare] = options[:no_wrap]
      else
        options[:bare] = false
      end

      # Stringify keys
      options = options.inject({}) { |h, (k, v)| h[k.to_s] = v; h }
      Source.context.call("compile", script, options)
    end

engine() click to toggle source

    # File lib/coffee_script.rb, line 55
    def engine
    end

engine=(engine) click to toggle source

    # File lib/coffee_script.rb, line 58
    def engine=(engine)
    end

version() click to toggle source

    # File lib/coffee_script.rb, line 61
    def version
      Source.version
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.