Method: AppMap::Util.try

Defined in:
lib/appmap/util.rb

.try(obj, *methods) ⇒ Object



255
256
257
258
259
260
261
# File 'lib/appmap/util.rb', line 255

def try(obj, *methods)
  return nil if methods.empty?

  return nil unless obj.respond_to?(methods.first)

  obj.public_send(*methods)
end