Sha256: a1de81417a07017e50b0d8f2598337d830f75a6d1d52191ce8005fcd1e9690ea

Contents?: true

Size: 393 Bytes

Versions: 5

Compression:

Stored size: 393 Bytes

Contents

module Ruby2JS
  class Converter

    # (ivar :@a)

    handle :ivar do |var|
      if self.ivars and self.ivars.include? var
        ruby2js = Ruby2JS::Converter.new(Ruby2JS.parse(self.ivars[var].inspect))
        ruby2js.width = @width
        ruby2js.enable_vertical_whitespace if @nl == "\n"
        ruby2js.to_js
      else
        var.to_s.sub('@', 'this._')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby2js-1.6.0 lib/ruby2js/converter/ivar.rb
ruby2js-1.5.0 lib/ruby2js/converter/ivar.rb
ruby2js-1.4.0 lib/ruby2js/converter/ivar.rb
ruby2js-1.3.0 lib/ruby2js/converter/ivar.rb
ruby2js-1.2.0 lib/ruby2js/converter/ivar.rb