Ruby/JavaScript mapping

Constructors

An alternative to creating objects with R() is to call their constructors directly. Use JavaScript style constructors (new R.String() ) when you know the type for performance. The Ruby style (R.String.new) implements the behaviour of Ruby.

// ::new has the same behaviour as its ruby equivalent.R.String.new('foo')// Javascript style instantiation is optimized for speed.newR.String('foo')

Naming/Aliases

Ruby allows special characters in its method names. Following rules apply: