Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
RSS
/
Utils
/
//opt/alt/ruby27/share/ri/system/RSS/Utils/get_file_and_line_from_caller-i.ri
U:RDoc::AnyMethod[iI""get_file_and_line_from_caller:ETI"-RSS::Utils#get_file_and_line_from_caller;TF:privateo: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;TcRDoc::NormalModule00