Project

General

Profile

Actions

Bug #8127

closed

NoMethodError for private / protected methods with Module#prepend

Added by dimko (Dmitriy Meremyanin) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
Backport:
[ruby-core:53555]

Description

=begin
Calling protected / private methods after using Module#prepend raises NoMethodError exception.

module Foo
end

class Record
prepend Foo

def protected_method
end

protected :protected_method
end

record = Record.new
record.respond_to?(:protected_method, true) #=> true
record.send(:protected_method) #=> NoMethodError: undefined method `protected_method'
=end


Related issues 1 (0 open1 closed)

Is duplicate of Backport200 - Backport #8005: Methods made private/protected after definition are made uncallable by prependClosednagachika (Tomoyuki Chikanaga)03/02/2013Actions

Updated by nobu (Nobuyoshi Nakada) almost 11 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0