Project

General

Profile

Actions

Bug #8091

closed

Class.new is not called when class is created using class keyword

Added by anuraguniyal (anurag uniyal) over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.0.0p0
Backport:
[ruby-core:53390]

Description

=begin
When a class is created using ((|class|)) keyword, Class.new is not called but if class is created using ((|Class.new|)) it is obviously called, there seems to be a dyssymmetry between ((|class X|)) and ((|Class.new|)) e.g.

class Class
  class << self
  alias new_orig new
  def new(*args)
    obj = new_orig *args
    print "created",obj,"\n"
    obj
  end
  end
end

class X
end

It doesn't print anything, but Class.new does

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0