Class: RubyJS.Kernel

Defined in: lib/corelib/kernel.coffee

Instance Method Summary

Instance Method Details

- (void) rubyjs()

A method to easily check whether an object is a RubyJS object with CoffeeScript.

foo.rubyjs?

- (void) box(obj, recursive, block)

TODO: find a better name for box. TODO: handle the case when calling R(true, -> ), R({}, -> )

- (void) w(str)

Equivalent to %w[] in Ruby

Creates an R.Array of R.String for every word separated by space.

Examples:

   R.w('foo bar   baz') # => ['foo', 'bar', 'baz']
   R.w('foo\nbar')      # => ['foo\nbar']
   R.w('')              # => ['']

- (void) r(a, b, excluding)

Shortcut for creating a R.Range.

@alias #rng

Examples:

   R.r(0,4)        # => (0..4)
   R.r(0,4, true)  # => (0...4)

- (void) f(flt)

Shortcut for creating floats

- (void) l(obj, recursive = false)

Returns primitive from an object, returns obj otherwise.

Examples:

   str = R('rubyjs')
   R.l(str)        # => 'rubyjs'
   R.l('js_str')   # => 'js_str'

- (void) catch_break(block, context = @undefined)

- (void) $Array(obj, recursive = false)

- (void) $Array_r(obj)

TODO: Remove from code

- (void) $Float(obj)

- (void) $Integer(obj)

- (void) $String(obj)

- (void) $Range(start, end, exclusive)

- (void) puts(obj)

- (void) rand(limit)