Class: RubyJS.Base

Defined in: lib/corelib/base.coffee
Inherits: RubyJS.Object

Overview

Methods in Base are added to R.

Instance Method Summary

Inherited Method Summary

Methods inherited from RubyJS.Object

.include, .__add_default_aliases__, #send, #respond_to, #to_enum, #tap

Instance Method Details

- (void) inspect(obj)

- (void) pollute_global()

Adds useful methods to the global namespace.

e.g. proc, puts, truthy, inspect, falsey

TODO: TEST

- (void) proc(key, args...)

Note: proc() calls methods and not properties

proc() is the equivalent to symbol to proc functionality of Ruby.

proc accepts additional arguments which are passed to the block.

Examples:


  R.w('foo bar').map( R.proc('capitalize') )
  R.w('foo bar').map( R.proc('ljust', 10) )

- (void) falsey(obj)

Check wether an obj is falsey according to Ruby

- (void) truthy(obj)

Check wether an obj is truthy according to Ruby

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

- (void) respond_to(obj, function_name)

- (void) extend(obj, mixin)