:
File.method(:read)
['array'].method(:flatten)
, - , .
Class.method.
, , Class#method.
, #<Method: File(IO).read> , read - , IO File.
, Ruby ( C), Method#source_location:
require 'set'
Set.new.method(:replace).source_location
, Set#replace Ruby 142.
If you use PRY as an alternative to IRB, you can even use:
show-source Set
From: /home/ricou/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/set.rb @ line 142:
Owner: Set
Visibility: public
Number of lines: 10
def replace(enum)
if enum.instance_of?(self.class)
@hash.replace(enum.instance_variable_get(:@hash))
else
clear
merge(enum)
end
self
end
source
share