Issue #3714 has been updated by yhara (Yutaka HARA).

Description updated
Target version changed from 2.0.0 to next minor


----------------------------------------
Feature #3714: Add getters for Enumerator
https://bugs.ruby-lang.org/issues/3714#change-31571

Author: marcandre (Marc-Andre Lafortune)
Status: Feedback
Priority: Low
Assignee: knu (Akinori MUSHA)
Category: core
Target version: next minor


=begin
 Given an enumerator, there is no way to know what receiver, method and arguments it is based upon (although one could use Enumerator#inspect and parse it to get the method).
 
 For sake of completeness and introspection, it could be useful to have access to them.
 
 This patch adds Enumerator#receiver, #method and #arguments: http://github.com/marcandre/ruby/commit/fd4c17f7fd
 
 Note that for Enumerator created with a block like Enumerator.new{|y| y << 1 << 2}, then receiver is a Enumerator::Generator, method is :each and arguments is []. This is consistent with inspect.
 
 Thanks.
=end



-- 
http://bugs.ruby-lang.org/