Class: Ruby2JS
- Inherits:
-
Object
- Object
- Ruby2JS
- Defined in:
- lib/ruby2js.rb
Overview
$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
Constant Summary collapse
- VERSION =
'0.0.2'
- LOGICAL =
:and, :not, :or
- OPERATORS =
[:[], :[]=], [:not], [:*, :/, :%], [:+, :-, :<<], [:and], [:or]
Instance Method Summary collapse
-
#initialize(sexp, vars = {}) ⇒ Ruby2JS
constructor
A new instance of Ruby2JS.
- #to_js ⇒ Object
Constructor Details
#initialize(sexp, vars = {}) ⇒ Ruby2JS
Returns a new instance of Ruby2JS.
10 11 12 |
# File 'lib/ruby2js.rb', line 10 def initialize( sexp, vars = {} ) @sexp, @vars = sexp, vars.dup end |
Instance Method Details
#to_js ⇒ Object
14 15 16 |
# File 'lib/ruby2js.rb', line 14 def to_js parse( @sexp, nil ) end |