Project

General

Profile

Actions

Bug #9542

closed

Delegator does not delegate protected methods

Added by vrinek (Konstantinos Karachalios) over 10 years ago. Updated over 3 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.1.0p0
Backport:
[ruby-core:60909]

Description

The Delegator of the "delegate" standard library has changed its behaviour since 2.0 because of the change in "respond_to?" concerning protected methods.

As of ruby 2.0, Delegator does not delegate protected methods any more.

In case this is indeed a bug, I will prepare a pull request on github fixing the issue.
On the other hand, if is intentional behaviour, something has to change in the documentation for "delegate" as well as Delegator#respond_to_missing? (at least the second argument's name). I can help with the code but I am not so confident in my documentation skills.


Files

the_bug.rb (283 Bytes) the_bug.rb vrinek (Konstantinos Karachalios), 02/20/2014 04:25 PM
output.txt (589 Bytes) output.txt vrinek (Konstantinos Karachalios), 02/20/2014 04:29 PM

Updated by rupert (Robert Pankowecki) almost 10 years ago

It would be really nice to see it fixed or at least a statement whether that's intentional or not.

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

Currently no way to tell if a method is called from a "protected" scope.

Updated by matz (Yukihiro Matsumoto) over 3 years ago

  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN)

It's intentional.

Matz.

Actions #4

Updated by mame (Yusuke Endoh) over 3 years ago

  • Status changed from Open to Rejected
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0