U:RDoc::AnyMethod[iI""get_file_and_line_from_caller:EFI"-RSS::Utils#get_file_and_line_from_caller;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"MReturns an array of two elements: the filename where the calling method ;TI"9is located, and the line number where it is defined.;To:RDoc::Markup::BlankLine o;
; [I"MTakes an optional argument +i+, which specifies how many callers up the ;TI"stack to look.;T@o;
; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"require 'rss/utils'
;TI"
;TI"
def foo
;TI"2 p RSS::Utils.get_file_and_line_from_caller
;TI"5 p RSS::Utils.get_file_and_line_from_caller(1)
;TI" end
;TI"
;TI"
def bar
;TI" foo
;TI" end
;TI"
;TI"
def baz
;TI" bar
;TI" end
;TI"
;TI" baz
;TI"# => ["test.rb", 5]
;TI"# => ["test.rb", 9]
;T:@format0o;
; [I"NIf +i+ is not given, or is the default value of 0, it attempts to figure ;TI"Dout the correct value. This is useful when in combination with ;TI" instance_eval. For example:;T@o;; [I"require 'rss/utils'
;TI"
;TI"
def foo
;TI"5 p RSS::Utils.get_file_and_line_from_caller(1)
;TI" end
;TI"
;TI"
def bar
;TI" foo
;TI" end
;TI"
;TI"Finstance_eval <<-RUBY, *RSS::Utils.get_file_and_line_from_caller
;TI"
def baz
;TI" bar
;TI" end
;TI"
RUBY
;TI"
;TI" baz
;TI"
;TI"# => ["test.rb", 8];T;
0:
@fileI"lib/rss/utils.rb;T:0@omit_headings_from_table_of_contents_below000[ I"
(i=0);T@EFI"
Utils;FcRDoc::NormalModule00