instance method
try!
Ruby on Rails 4.1.16
Since v4.0.13Signature
try!(*a, &b)
Same as #try, but will raise a NoMethodError exception if the receiving is not nil and does not implement the tried method.
Parameters
-
arest -
bblock
Source
# File activesupport/lib/active_support/core_ext/object/try.rb, line 51
def try!(*a, &b)
if a.empty? && block_given?
yield self
else
public_send(*a, &b)
end
end
Defined in activesupport/lib/active_support/core_ext/object/try.rb line 51
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Object