Method: Class.new

Defined in:
lib/source/ruby.rb

.new(class_name, superclass = Object) ⇒ Object

call-seq:

Class.new(class_name, superclass = Object) -> class

Creates a new class with the given __superclass___ (or Object if no superclass is given). Unlike in Ruby, where you need only assign the class object to a constant in order to give it a name, in Red you must also pass the class name as a string argument.

FIX: Incomplete



1088
1089
1090
1091
# File 'lib/source/ruby.rb', line 1088

def self.new(class_name, superclass = Object)
  `Red._class(class_name.__value__,superclass,function(){})`
  return `window['c$'+class_name.__value__]`
end