Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/ruby-util/object.rb
Instance Method Summary collapse
-
#try(method, *args) ⇒ Object
Neat method for calling methods that might be undefined.
Instance Method Details
#try(method, *args) ⇒ Object
Neat method for calling methods that might be undefined.
3 4 5 |
# File 'lib/ruby-util/object.rb', line 3 def try(method, *args) send(method, *args) if respond_to?(method) end |