method

try!

Importance_1
v6.1.3.1 - Show latest stable - 0 notes - Class: Object
try! public

Same as #try, but raises a NoMethodError exception if the receiver is not nil and does not implement the tried method.

"a".try!(:upcase) # => "A"
nil.try!(:upcase) # => nil
123.try!(:upcase) # => NoMethodError: undefined method `upcase' for 123:Integer
Show source
Register or log in to add new notes.