Method: Lazier::Object#safe_send
- Defined in:
- lib/lazier/object.rb
#safe_send(method, *args, &block) ⇒ Object|nil
Sends a method to the object. If the objects doesn't not respond to the method, it returns nil instead of raising an exception.
64 65 66 67 68 |
# File 'lib/lazier/object.rb', line 64 def safe_send(method, *args, &block) send(method, *args, &block) rescue NoMethodError nil end |