3 ms·
There isn't really anyway to monkeypatch `try` to use the operator. `try` API is inherently based on metaprogramming (passing a symbol to call), and have differ
by hueho 11y ago
There isn't really anyway to monkeypatch `try` to use the operator. `try` API is inherently based on metaprogramming (passing a symbol to call), and have different semantics than the operator (by default it won't throw if a non-existent method is called in a non-nil object, while the operator will thrown a NoMethodError)
https://github.com/rails/rails/blob/4-2-stable/activesupport/lib/active_support/core_ext/object/try.rb#L62 https://github.com/rails/rails/blob/4-2-stable/activesupport...