D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Integer
/
Filename :
try_convert-c.ri
back
Copy
U:RDoc::AnyMethod[iI"try_convert:ETI"Integer::try_convert;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"9If +object+ is an \Integer object, returns +object+.;To:RDoc::Markup::Verbatim; [I"#Integer.try_convert(1) # => 1 ;T:@format0o; ; [I"9Otherwise if +object+ responds to <tt>:to_int</tt>, ;TI"9calls <tt>object.to_int</tt> and returns the result.;To;; [I"&Integer.try_convert(1.25) # => 1 ;T;0o; ; [I"CReturns +nil+ if +object+ does not respond to <tt>:to_int</tt>;To;; [I"&Integer.try_convert([]) # => nil ;T;0o; ; [I"RRaises an exception unless <tt>object.to_int</tt> returns an \Integer object.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"<Integer.try_convert(object) -> object, integer, or nil ;T0[ I" (p1);T@!FI"Integer;TcRDoc::NormalClass00