Skip to content
instance method

Method#source_location

() -> [ ::String, ::Integer ]?
meth.source_location → [String, Integer, Integer, Integer, Integer]

Returns the location where the method was defined. The returned Array contains:

(1) the Ruby source filename
(2) the line number where the definition starts
(3) the column number where the definition starts
(4) the line number where the definition ends
(5) the column number where the definitions ends

This method will return nil if the method was not defined in Ruby (i.e. native).

See also #receiver #super_method #parameters #to_proc also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0