--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Invokes the method identified by the symbol <tt>method</tt>, passing it any arguments and/or the block specified, just like the regular Ruby <tt>Object#send</tt> does.
- !ruby/struct:SM::Flow::P 
  body: <b>Unlike</b> that method however, a <tt>NoMethodError</tt> exception will <b>not</b> be raised and <tt>nil</tt> will be returned instead, if the receiving object is a <tt>nil</tt> object or NilClass.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::P 
  body: Without try
- !ruby/struct:SM::Flow::VERB 
  body: "  @person &amp;&amp; @person.name\n"
- !ruby/struct:SM::Flow::P 
  body: or
- !ruby/struct:SM::Flow::VERB 
  body: "  @person ? @person.name : nil\n"
- !ruby/struct:SM::Flow::P 
  body: With try
- !ruby/struct:SM::Flow::VERB 
  body: "  @person.try(:name)\n"
- !ruby/struct:SM::Flow::P 
  body: <tt>try</tt> also accepts arguments and/or a block, for the method it is trying
- !ruby/struct:SM::Flow::VERB 
  body: "  Person.try(:find, 1)\n  @people.try(:collect) {|p| p.name}\n"
full_name: Object#try
is_singleton: false
name: try
params: (method, *args, &block)
visibility: public
