Class: Ruby2JS

Inherits:
Object
  • Object
show all
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

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_jsObject



14
15
16
# File 'lib/ruby2js.rb', line 14

def to_js
  parse( @sexp, nil )
end