Method: Prototype.new

Defined in:
lib/alib-0.5.1/prototype.rb,
lib/alib-0.5.1/prototype-0.3.0.rb

.new(parent = Object, *a, &b) ⇒ Object Also known as: exnihilo, ex_nihilo



165
166
167
168
169
170
171
172
173
174
# File 'lib/alib-0.5.1/prototype.rb', line 165

def new parent = Object, *a, &b
  parent = parent.class unless Class === parent
  c = Class.new parent
  c.extend Prototypical
  c.__prototype_table__.update parent.__prototype_table__ if
    parent.respond_to? '__prototype_table__'
  c.__prototype_prototype__ &b
  obj = c.new *a 
  obj
end