Issue #8391 has been reported by stephenmurdoch (stephen murdoch).

----------------------------------------
Bug #8391: Introduce Object.singleton_method(:sym)
https://bugs.ruby-lang.org/issues/8391

Author: stephenmurdoch (stephen murdoch)
Status: Open
Priority: Low
Assignee: matz (Yukihiro Matsumoto)
Category: syntax
Target version: 
ruby -v:  2.0.0
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


In the code below:

  module A
    def self.hello end
    def world end
  end

We can reflect on the instance method like so:

  A.instance_methods            # => [:world]
  A.instance_method :world   # => #<UnboundMethod: A#world> 

It's neat, but when we come to the singleton:

  A.singleton_methods           # => [:hello]
  A.singleton_method :hello   # => undefined method `singleton_method' for A:Module

I find Object.singleton_method(:sym) more syntactically consistent than Object.method(:sym).


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