Class: Zfben_libjs::Coffee

Inherits:
Source
  • Object
show all
Defined in:
lib/zfben_libjs/support_source/coffee.rb

Instance Attribute Summary

Attributes inherited from Source

#compiled, #filepath, #minified, #options, #source

Instance Method Summary collapse

Methods inherited from Source

#compile, #download!, #initialize, #minify, #name, #remote?, #type

Constructor Details

This class inherits a constructor from Zfben_libjs::Source

Instance Method Details

#before_compileObject



6
7
8
# File 'lib/zfben_libjs/support_source/coffee.rb', line 6

def before_compile
  @compiled = CoffeeScript.compile(@source)
end

#before_minifyObject



10
11
12
# File 'lib/zfben_libjs/support_source/coffee.rb', line 10

def before_minify
  @minified = Zfben_libjs::Js.new(:source => @source, :options => @options).minify
end

#to_jsObject



2
3
4
# File 'lib/zfben_libjs/support_source/coffee.rb', line 2

def to_js
  compile
end