From: knu@... Date: 2017-09-17T10:42:40+00:00 Subject: [ruby-core:82840] [Ruby trunk Feature#13904] getter for original information of Enumerator Issue #13904 has been updated by knu (Akinori MUSHA). Assignee set to knu (Akinori MUSHA) ---------------------------------------- Feature #13904: getter for original information of Enumerator https://bugs.ruby-lang.org/issues/13904#change-66732 * Author: znz (Kazuhiro NISHIYAMA) * Status: Open * Priority: Normal * Assignee: knu (Akinori MUSHA) * Target version: ---------------------------------------- At https://gitter.im/red-data-tools/ja?at=59b0aaa097cedeb04828e268 , mrkn says narray and pycall use internal information of ruby to check `Range#step(n)`. People of red-data-tools/ja suggest subclass of Enumerator. But I think it does not match Ruby's '������������������' (I don't know this word in English), so I suggest to add some methods to Enumerator class. proof of concept attached. Usage: ``` % irb -r irb/completion --simple-prompt >> e=(1..2).step(3) => # >> e.receiver => 1..2 >> e.method_name => :step >> e.arguments => [3] ``` `#method` is conflict with `Kernel#method`, so use `#method_name` instead. ---Files-------------------------------- poc.diff (1.42 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: