I read the UnboundMethod#source_location
(http://www.ruby-doc.org/core-2.0/UnboundMethod.html#method-i-source_location)
says:

(a) Returns the Ruby source filename and line number containing this
method (b) `nil` if this method was not defined in Ruby (i.e. native)

class Foo
    def snow
        "wow"
    end
end

Foo.instance_method(:snow) # => #<UnboundMethod: Foo#snow>
Foo.instance_method(:snow).source_location
# => ["-", 2]

--in the above case - why does the "source file name" not come ?

String.instance_method(:to_str) # => #<UnboundMethod: String#to_str>
String.instance_method(:to_str).source_location
# => nil

--in the above case - why does the `nil` come ?

-- 
Posted via http://www.ruby-forum.com/.