Project

General

Profile

Actions

Feature #6452

open

Allow extend to override class methods

Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 9 years ago. Updated 12 months ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:45128]

Description

module A
  def self.a
    'a1'
  end
end

module B
  def a
    'a2'
  end

  def b
    'b'
  end
end

A.extend B

assert A.a == 'a2' # this is the change I'm proposing - currently it is 'a1'
assert A.b == 'b'

Would this change be possible for 3.0?


Related issues

Related to Ruby master - Feature #1102: Prepend ModuleClosednobu (Nobuyoshi Nakada)02/04/2009Actions
Actions

Also available in: Atom PDF